how to add stuff to crontab without using crontab -e

Antonio Olivares olivares14031 at yahoo.com
Mon Apr 13 03:53:37 UTC 2009


> [olivares at localhost Documents]$ ./edit-crontab 
> ./edit-crontab: line 7: unexpected EOF while looking for
> matching `"'
> 
>

I have fixed it.  Thank you very much again for your kind help :)

[olivares at localhost Documents]$ crontab -l
# min hr dom mon dow command
30 04 * * 1-5 ~/alarm  >& /dev/null
30 05 * * 1-5  killall -9 /usr/bin/mplayer >& /dev/null
#10 06 *  *  ~/alarm2 >& /dev/null

[olivares at localhost Documents]$ ./edit-crontab 
[olivares at localhost Documents]$ crontab -l
# min hr dom mon dow command
30 04 * * 1-5 ~/alarm  >& /dev/null
30 05 * * 1-5  killall -9 /usr/bin/mplayer >& /dev/null
#10 06 *  *  ~/alarm2 >& /dev/null

15 16 * * 1-5 /usr/bin/poweroff >/dev/null 2>&1
[olivares at localhost Documents]$ cat edit-crontab
#!/bin/sh
set -ue
tmp=/tmp/crontab$$
crontab -l >"$tmp"
echo "15 16 * * 1-5 /usr/bin/poweroff >/dev/null 2>&1" >>"$tmp"
crontab "$tmp"
rm "$tmp"


Regards,

Antonio 


      




More information about the fedora-list mailing list