[nas-2000] Re: Howto using crontab

  • From: philipp Wehrheim <flipstar@xxxxxxx>
  • To: nas-2000@xxxxxxxxxxxxx
  • Date: Sun, 26 Aug 2007 22:37:05 +0200

Hi everybody,

sorry for the late reply if been on holiday ...

crontab -e is the best way to edit the crontab.

For the podcatcher is use a small script that adds a entry into the
crontab for root.

snip:

---------->8-------------->8--------------
#!/bin/sh
#
# little helper prog to add one line to the crontab
# without deleting all the other entries
#
PODCATCHER_CRONJOB="25 19 * * *
/system/overlay/apps/podcatcher/podcatcher.sh 2&>1 >/dev/null"
#
#
crontab -l root 2> /dev/null | grep "podcatcher.sh" 2>&1 >/dev/null
if [ $? -ne 0 ]; then
   echo "adding podcatcher cronjob to crontab"
   crontab -l root 2> /dev/null > /tmp/root.crontab
   echo "${PODCATCHER_CRONJOB}" >> /tmp/root.crontab
   #
   # playback the new crontab
   crontab - < /tmp/root.crontab
   cat /tmp/root.crontab
else
   echo "podcatcher cronjob found in roots crontab skipping ..."
fi
---------->8-------------->8--------------


by the way i will move next week so I guess i cant response to mail
quickly.


--
flip

Sebastian wrote:
> xxolli schrieb:
>> Hello,
>>
>> I have edited the crontab (/etc/crontab), but it doesn´t work. Must I
>> edit some other files, to use the crontab?
>>   
> Hi
> 
> I edited /var/spool/cron/crontabs/root and it works.
> 
> Sebastian
>> Regards
>>  xxolli
>>
>>   
> 
> 

Other related posts: