DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-08-12 04:44:28

dwfa
Member
Registered: 2008-01-24
Posts: 5

crontab issues

Hi all,

  I got myself a DNS-343 (have two DNS-323s) .  Got ffp running with no issues.  So far so good.  I want to add stuff to cron to run at periodic intervals, but for some reason I am not able to update crontab when the system boots.  I have a scripts that I put together, similar to ones I found on on the net, to "programmaticlly" update crontab when the system boots.  When I run the script manually from the command line it works; but for some reason it does not work when the system boots.  I have it working correctly on my DNS-323 systems. Very confused.  Here is the script - pretty simple ...

# PROVIDE: updateCrontab
# REQUIRE:

# define the tmp file to use
crontabFile=/mnt/HD_a2/ffp/tmp/crontab.txt

# add header info
cat > $crontabFile << EOF
# crontab for root
# Format is
# min hour dayOfMonth month dayOfWeek command2Execute

EOF

# get current crontab entries
/bin/crontab -l >> $crontabFile

# add my stuff
cat >> $crontabFile << EOF

# backup video every 2 days starting from the 1st
# @ 2:05 am
5 2 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29 * * /mnt/HD_a2/ffp/bin/rsync -a --delete -v -v /mnt/HD_a2/video/ /mnt/HD_b2/video > /mnt/HD_a2/ffp/tmp/rsyncLog-video.txt 2>&1

# backup audio every 2 days starting from the 2nd
# @ 2:05 am
5 2 2,4,6,8,10,12,14,16,18,20,22,24,26,28,30 * * /mnt/HD_a2/ffp/bin/rsync -a --delete -v -v /mnt/HD_a2/audio/ /mnt/HD_b2/audio > /mnt/HD_a2/ffp/tmp/rsyncLog-audio.txt 2>&1

EOF

# update crontab
/bin/crontab $crontabFile

# remove tmp file
#rm -f $crontabFile

Offline

 

#2 2010-09-01 05:03:18

FunFiler
Member
Registered: 2010-05-23
Posts: 577

Re: crontab issues

I had to add a delay to my script on a DNS323 in order for it to "stick" on a reboot. You could try adding "/ffp/bin/sleep 3" to the top of the script. Not a big deal since rebooting is rare.


3 * (DNS-323 with 2 * 2TB) = 12TB Running FW v1.08 & FFP v0.5
Useful Links: Transmission, Transmission Remote, Automatic

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB