NAS542 Backup from network
![NewSouth](https://us.v-cdn.net/6029482/uploads/avatarstock/n5VP8WBH3IZR4.png)
NewSouth
Posts: 3
Freshman Member
![](https://www.zyxel.com/library/assets/zyxel-forum/freshman_member.png)
Hello
I have two NAS542 - called NASCI and NASBU. I need to backup data from NASCI to NASBU, and its easy with tool "archive scheduler'. But the problem is NASCI cant see NASBU in destination of data transmitting because of firewall rules that i can't change. Otherwise NASBU CAN see NASCI to backup data. So i need to set up NASBU to backup data from network source to it's own storage, is it possible?
I found solution using rsync, but i cant schedule it
Thanks
I have two NAS542 - called NASCI and NASBU. I need to backup data from NASCI to NASBU, and its easy with tool "archive scheduler'. But the problem is NASCI cant see NASBU in destination of data transmitting because of firewall rules that i can't change. Otherwise NASBU CAN see NASCI to backup data. So i need to set up NASBU to backup data from network source to it's own storage, is it possible?
I found solution using rsync, but i cant schedule it
Thanks
0
Accepted Solution
-
Install in Entware the cron package, enable itchmod a+x /opt/etc/init.d/S10cronEdit the file /opt/etc/crontab, to meet your needs. (Google for crontab file syntax) I'd remove all current /opt/etc/cron.* entries. They don't do anything, but might spin up the disk.Then (re)start cron/opt/etc/init.d/S10cron restart
0
All Replies
-
How does that rsync solution work?
0 -
I installed Entware on bots NAS,
Then i run following commands:#start entware tools mkdir -p /i-data/298a8096/opt > /dev/null 2>&1 mkdir -p /opt mount -o bind /i-data/298a8096/opt /opt /opt/etc/init.d/rc.unslung start PATH=$PATH:/opt/bin:/opt/sbin #copying SSH keys to ~/.ssh, nessesery after reboot: mkdir ~/.ssh/ cp /i-data/298a8096/opt/id_rsa ~/.ssh/ cp /i-data/298a8096/opt/id_rsa.pub ~/.ssh/ cp /i-data/298a8096/opt/known_hosts ~/.ssh/ #run rsync /i-data/298a8096/opt/bin/rsync -arht --rsync-path=/i-data/86e8767a/opt/bin/rsync --info=progress2 --log-file=/i-data/298a8096/nascibackup/nascibackup.log *****:/i-data/86e8767a/Project/Nascibackup /i-data/298a8096/nascibackup/ | chmod 775 -R /i-data/298a8096/nascibackup/ | chown -R admin /i-data/298a8096/nascibackup/
/i-data/298a8096/ is my hdd volume.
What should i do to schredule it, like to run it once a week?
How to keep this schedule after reboot?
0 -
Install in Entware the cron package, enable itchmod a+x /opt/etc/init.d/S10cronEdit the file /opt/etc/crontab, to meet your needs. (Google for crontab file syntax) I'd remove all current /opt/etc/cron.* entries. They don't do anything, but might spin up the disk.Then (re)start cron/opt/etc/init.d/S10cron restart
0 -
Thank you Mijzelf for answer!
I installed cron and it work properly (i tested with 1 min script) until NAS reboot.
After reboot it doesnt work, and i need to start Entware (?) by this commands:mkdir -p /i-data/298a8096/opt > /dev/null 2>&1 mkdir -p /opt mount -o bind /i-data/298a8096/opt /opt /opt/etc/init.d/rc.unslung start
I installed Entware wrong i guess. I used this instruction: https://github.com/Entware/Entware/wiki/Install-on-Zyxel-NAS542
There is problem to execute "entware" scrypt in .system/zy-pkgs:~ # /i-data/.system/zy-pkgs/USRPKG_DEPS_START /i-data/.system/zy-pkgs/USRPKG_DEPS_START: line 1: entware: not found ~ # ls /i-data/.system/zy-pkgs/entware /i-data/.system/zy-pkgs/entware ~ # /i-data/.system/zy-pkgs/entware sh: /i-data/.system/zy-pkgs/entware: not found ~ #
So the script is there, but it cant be executed even over SSH. Where might be the problem?Edit:i trying to test how the USRPKG_DEPS_START works when NAS booting, and seems it doesnt: i added this line to USRPKG_DEPS_START:echo "TESTAUTOBOOT" >> /i-data/298a8096/nascibackup/test1min.logbut there is nothing is my test1min.log after NAS booting. If i execute script USRPKG_DEPS_START by myself, "TESTAUTOBOOT" appears in test1min.logSo this USRPKG_DEPS_START doesnt execute on boot?0 -
Hm. It should work. The USRPKG_DEPS_START is handled by /etc/init.d/zypkg_controller.sh, and this is the code:
<div># - start to startup packages according to ${USRPKG_DEPS_START}</div><div>while read zypkg; do</div><div> bname=`basename ${zypkg}`</div><div> zypkg=${ZYPKG_PKG_SRC_PATH}/${bname}</div><div> Processed_Packages=${Processed_Packages}:${bname}</div><div> write_log "- starting package \"${bname}\" ..."</div><div> #ckeck ZYPKG_DEPS format</div><div> CHKVERSION=`grep "/i-data/" ${zypkg}`</div><div> if [ "$?" != "0" ]; then</div><div> PKGVOLPATH=`grep ${bname} ${PKGSTATUSFILE} |grep "Installed-Rule" |awk -F":" '{print $2}' |sed 's/\/$//g' |sed 's/ //g'`</div><div> zypkg=${PKGVOLPATH}/etc/init.d/${bname}</div><div> fi</div><div> if [ ! -x ${zypkg} ]; then</div><div> write_log "---> Error: start-up program \"${zypkg}\" is not existed or not excutable"</div><div> else</div><div> ${zypkg} startup</div><div> if [ "$?" == "0" ]; then</div><div> write_log "---> start \"${bname}\" successfully."</div><div> else</div><div> write_log "---> start \"${bname}\" failed."</div><div> fi</div><div> fi</div><div>done < ${USRPKG_DEPS_START}</div><div><br></div>
So the script (entware in this case) has to be in the ZYPKG_PKG_SRC_PATH directory (/i-data/.system/zy-pkgs), it has to contain the string '/i-data/' and has to be executable.If /i-data/.system/zy-pkgs/entware doesn't execute, than it can't work. So you first have to solve that. I suggest to 'debug' it, by executingsh -x /i-data/.system/zy-pkgs/entware/Edit: I hate this forum software. It has borked up my scriptlet. In the editor it looks fine.0 -
just leave this here
0
Categories
- All Categories
- 414 Beta Program
- 2.2K Nebula
- 130 Nebula Ideas
- 88 Nebula Status and Incidents
- 5.4K Security
- 166 USG FLEX H Series
- 255 Security Ideas
- 1.4K Switch
- 71 Switch Ideas
- 999 Wireless
- 36 Wireless Ideas
- 6.2K Consumer Product
- 233 Service & License
- 370 News and Release
- 77 Security Advisories
- 24 Education Center
- 5 [Campaign] Zyxel Network Detective
- 2.9K FAQ
- 34 Documents
- 34 Nebula Monthly Express
- 80 About Community
- 69 Security Highlight