June 1, 201016 yr I added a couple of lines in my crontab to automatically backup some of my files using rsnapshot. It works pretty well and when I reboot I can see that my modified crontab is automatically loaded. I noticed that sometimes the crontab reverts to the default one (and without rebooting the machine). I think it has to do with stopping or starting the array or modifying user share settings. This is really annoying because after few weeks I discover that no backup has been performed. What script resets the crontab when array is stopped or started? Should I put my crontab tweak at a better location rather than /boot/config/go? /boot/config/go ... # Install/configure rsnapshot /boot/config/myconfig/rsnapshot-setup.sh /boot/config/myconfig/rsnapshot-setup.sh #!/bin/sh installpkg /boot/packages/rsnapshot-1.3.1-i486-1af.tgz cp /boot/config/myconfig/rsnapshot.conf /etc/ crontab -l >/tmp/crontab echo "# start rsnapshot periodicaly" >>/tmp/crontab echo "15 05 * * * /usr/bin/rsnapshot daily" >>/tmp/crontab echo "10 02 * * 01 /usr/bin/rsnapshot weekly" >>/tmp/crontab echo "05 00 01 * * /usr/bin/rsnapshot monthly" >>/tmp/crontab crontab /tmp/crontab
June 1, 201016 yr I added a couple of lines in my crontab to automatically backup some of my files using rsnapshot. It works pretty well and when I reboot I can see that my modified crontab is automatically loaded. I noticed that sometimes the crontab reverts to the default one (and without rebooting the machine). I think it has to do with stopping or starting the array or modifying user share settings. This is really annoying because after few weeks I discover that no backup has been performed. What script resets the crontab when array is stopped or started? Should I put my crontab tweak at a better location rather than /boot/config/go? /boot/config/go ... # Install/configure rsnapshot /boot/config/myconfig/rsnapshot-setup.sh /boot/config/myconfig/rsnapshot-setup.sh #!/bin/sh installpkg /boot/packages/rsnapshot-1.3.1-i486-1af.tgz cp /boot/config/myconfig/rsnapshot.conf /etc/ crontab -l >/tmp/crontab echo "# start rsnapshot periodicaly" >>/tmp/crontab echo "15 05 * * * /usr/bin/rsnapshot daily" >>/tmp/crontab echo "10 02 * * 01 /usr/bin/rsnapshot weekly" >>/tmp/crontab echo "05 00 01 * * /usr/bin/rsnapshot monthly" >>/tmp/crontab crontab /tmp/crontab the unRAID web-interface uses its own copy of the "cron" file. It does not extract one from the crontab command each time it makes a change. It is easy though to fix. All you need is to add one more line to your rsnapshot-setup.sh script. That line is shown below. (The last character on the line is a "-" ) #!/bin/sh installpkg /boot/packages/rsnapshot-1.3.1-i486-1af.tgz cp /boot/config/myconfig/rsnapshot.conf /etc/ crontab -l >/tmp/crontab echo "# start rsnapshot periodicaly" >>/tmp/crontab echo "15 05 * * * /usr/bin/rsnapshot daily" >>/tmp/crontab echo "10 02 * * 01 /usr/bin/rsnapshot weekly" >>/tmp/crontab echo "05 00 01 * * /usr/bin/rsnapshot monthly" >>/tmp/crontab crontab /tmp/crontab cp /tmp/crontab /var/spool/cron/crontabs/root- When unRAID next makes a change to cron, it starts with the copy in "/var/spool/cron/crontabs/root-" rather than use the crontab command to get the starting point. Edit: On unRAID 5.X releases, unRAID no longer uses root-, and following the above suggestion will result in warnings in the syslog of a non-existant user root-. In other words, do not follow the hint in this post. Joe L.
Archived
This topic is now archived and is closed to further replies.