Backup data files to synology NAS

Thanks @hek

Maybe you/Chris could spin this off into a dedicated thread in this DataMine child forum.

UPDATE - I did everything as instructed last night and had Vera pointing to my NAS, (the plugin was showing all the tracked variables etc. but when I came down this morning the newly mapped drive/mount in Vera was missing… The NAS is still on, and it’s IP address and logon details are still listed in the Datamine app (but 0 devices are now being monitored)

I have mouted the share again, and reloaded Vera a few times, but DataMine is no longer seeing it? Any ideas?

[quote=“parkerc, post:21, topic:175444”]UPDATE - I did everything as instructed last night and had Vera pointing to my NAS, (the plugin was showing all the tracked variables etc. but when I came down this morning the newly mapped drive/mount in Vera was missing… The NAS is still on, and it’s IP address and logon details are still listed in the Datamine app (but 0 devices are now being monitored)

I have mouted the share again, and reloaded Vera a few times, but DataMine is no longer seeing it? Any ideas?[/quote]

That is weird… It worked the first time but not when reloading? Do you have a max limit of logged in users on NAS? Can you determine which users is logged in (on synology you can…)?

Did the unmount happen after the nightly Vera (3 o’clock) restart?

Hmm…

It is weird and Datamine will still not re-connect to it… It could have occurred at 3am I’m not sure, I’m not even sure there is a way to check.

I’m using it on a ReadyNas DUO (v1) and there is no user limit on it that I am aware of. Not sure what else I can check? I tried this, not sure if that helps you? Is there anything else I can try to see if Vera sees the Share.

[code]//192.168.1.101/backup
1943483024 1387176176 556306848 71% /nas

root@MiOS_33456789:~# cd /nas
root@MiOS_33456789:/nas# ls
ls: can’t open ‘.’: Value too large for defined data type
root@MiOS_33456789:/nas#
[/code]

Also running http://veraIP/port_3480/data_request?id=lr_dmCtrl&control=debug for Datamine is quite short in length, and does not give me much to go on (well not to the untrained eye anyway)

what does it say when typing

> mount

Mine shows something like this:

...
//192.168.178.36/nas/HA/dataMineMounted on /nas type cifs (rw,relatime,unc=\\192.168.178.36\nas,username=admin,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.178.36,prepath=/HA/dataMineMounted,posixpaths,serverino,acl,rsize=16384,wsize=57344,actimeo=1)

Interesting…

There are some subtle differences. Here’s yours next to mine.

//192.168.1.101/backup on /nas type cifs (rw,mand,relatime,unc=\\192.168.1.101\backup,username=admin,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.101,file_mode=0755,dir_mode=0755,serverino,rsize=16384,wsize=57344,actimeo=1)

//192.168.178.36/nas/HA/dataMineMounted on /nas type cifs (rw,relatime,unc=\192.168.178.36\nas,username=admin,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.178.36,prepath=/HA/dataMineMounted,posixpaths,serverino,acl,rsize=16384,wsize=57344,actimeo=1)

UPDATE - Just found this post plugout.net • View topic - minor error with smb mount which alludes to this being a bug in earlier CIFS version, maybe what we’re using - could that be due to the version of open WRT running on Vera? (CIFS Client [Old OpenWrt Wiki]) Would appreciate your thoughts/feedback?

@HEk @Chris

The mount has dropped again…

df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 4608 4608 0 100% /rom tmpfs 31240 4744 26496 15% /tmp tmpfs 512 0 512 0% /dev /dev/mtdblock7 11264 3252 8012 29% /overlay overlayfs:/overlay 11264 3252 8012 29% / /dev/mtdblock8 4480 4480 0 100% /mios

Quick question - as we did

 opkg install cifsmount

Is there any reason why we can’t use cifsmount //192.168.1.123/backup /nas -Uadmin -Ppassword ? I tried to but it says -ash: cifsmount: not found

cj compiled the packages 30/5. I only guess he used the latest package. Maybe you could contact him for more info about the version used.
It seems to work fine for me and Chris so it is probably a combination of the NAS you’re using and vera cifs package. Is it possible to upgrade NAS packages?

> opkg status kmod-fs-cifs Package: kmod-fs-cifs Version: 2.6.37.1-1 Depends: kernel (= 2.6.37.1-1) Provides: Status: install hold,user installed Architecture: ramips Installed-Time: 1369948949

Hi Hek

Do you think the version on the destination is the cause, rather than the one on Vera?
The strange thing is that it worked first time, but now not at all…

UPDATE - surfing the net I can across some posts that had the same issue as me when I tried to do a ls command whilst in the new NAS share (Error was - “can’t open ‘.’: Value too large for defined data type”)

They suggested you add nounix,noserverino to the mount options, making it.

mount -t cifs -o user=admin,pass=Password,nounix,noserverino //192.168.1.101/backup /nas

So i did this and I can now do a ls call on Vera and it will show ma all the Datamine files on my NAS share and i can also do a mkdir and create files too.

Checking what Vera see as the target files permissions they see this.

-rwxr-xr-x 1 root root 25623 Aug 25 23:59 dataMineConfig.json

But DataMine still cannot see it.

If you can read/write files on the mounted disk from command line then dataMine also should be able to do it…

[quote=“Chris, post:16, topic:175444”]Install CIFS as per the info earlier in this thread, and copy all the files from the /dataMine directory on your USB to your NAS. Set the variable SetMountOption to “-t cifs -o user=XXX,pass=YYY”, and SetMountPoint to the NAS share (eg “//192.168.2.10/share”).

dataMine should then mount the NAS on your next startup - in theory it should also unmount your USB - it worked for me, but you should double check this.[/quote]

I agree, I have updated the plugin to reference the new mount options and entered mkdir xyz.txt on the command line and that works too, yet Datmine still cannot seem to see the share and still reports 0 items being monitored?

Any other ideas how I can get dataMine to see/use the share (especially when it seems I can do so from the command line?)

Also any idea why as we’ve already mounted the share, why I cannot just specify that share name /nas in the settings?

Hi @Chris.

When you can (as I’m sure you’re very busy) I’d really appreciate your help on what else I can do from a Datamine application point of view?

As it seems I can now create and edit files from the command line and also from the test luup(lua) code console window too.

I just can’t (for the life of me) get Datamine to see/use the new share /nas. It’s bound to be something simple :wink:

@chris - just a polite nudge to see if you have any ideas as to why DataMine can’t see or write to a share I can write to and update files on a remote CIFS share?

Just another tap at the window to see if @Chris has is able to help me use a CIFS share on my NAS for DataMine. This functionaity is key for me…

Hi,

All my data have disappeared so I did try the process described here.

Finally I’ve decided to use USB drive for live data and keep backup on NAS.

I did re-use the process described here and did tweak it a bit like this :

The script is created and run on Vera (script is called dm-backup.sh):

#!/bin/ash
date="`date +%Y-%m-%d`"
mkdir /tmp/log/cmh/nas
destdir=/tmp/log/cmh/nas
mount -o remount -t cifs -o user=vera,pass=xxx //192.168.0.x/Vera /$destdir
# get the files. Vera does not have rsync, so we use regular scp
cp -R /tmp/log/cmh/dataMine $destdir/
# create the backup tar ball
tar -cpzf $destdir/datamine_$date.tar.gz $destdir/dataMine
# fix rights..
chmod 600 $destdir/datamine_$date.tar.gz
# remove tempfiles
rm -rf $destdir/dataMine

There is no backup cleanup (the find command on Vera does not include the mtime attribute)

Chmod the script to make it runnable

chmod a+rx backup.sh

Edit crontab on VERA

vi /etc/crontabs/root  

Add the line (note tab characters!)

0 1 * * * /root/dm-backup.sh #Backup

You will end up with a daily backup at 1AM on your NAS. The mount command has been modified to include the remount statement to avoid duplication of mount points.

Systemic

I’ve just installed dataMine and am trying to configure it to put the logs on my NAS following the instructions in this thread. But every time I start dataMine it asks me for a USB stick.

Do I initially need to put a USB stick in the Vera to get dataMine to start the first time?

Hi

i am in the same process. I would suggest first to use the USB stick and make it working so you can see all is OK, test the datamine GUI etc.
Then I would try to connect to a NAS.

I think that I also succesfully migrated for Datamine to store on the synology NAS now… :wink:

(i hope)

everythings seems to work fine, USB is removed. let’s see how long this works

the mount cmd in Vera returned the following:

//xxx.xxx.x.x/Volume1/datamine on /dataMine type cifs (rw,mand,relatime,unc=\xxx.xxx.x.x/Volume1\datamine,username=hidden,uid=0,noforceuid,gid=0,noforcegid,addr=xxx.xxx.x.x,posixpaths,serverino,acl,rsize=16384,wsize=57344,actimeo=1)

adding any variable channels is immediately visible on the NAS. so far so good i believe.

(note: for privacy i have hidden the ip address which shows xxx)

I’d love to do this. I’ve created a user account on Synology for Vera. I’ve created a shared folder for Vera data. I SSH’d into Vera with PuTTY, downloaded the first package, and received this error when trying to install:

[code]Collected errors:

  • pkg_hash_fetch_best_installation_candidate: Packages for kmod-crypto-md5 found, but incompatible with the architectures configured
  • opkg_install_cmd: Cannot install package kmod-crypto-md5.[/code]

Any thoughts on what’s going wrong here?

It looks like this package is only for the Vera Lite / Vera 3 platform and you are trying to install on a Vera 2.

  • Garrett

Huh–I didn’t realize it was specific to Vera 3. Is there a Vera 2 solution?

I don’t foresee upgrading to a 3. I’ll skip over it to whatever’s next.