[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: how to add stuff to crontab without using crontab -e



> [olivares 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 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 localhost Documents]$ ./edit-crontab 
[olivares 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 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 


      


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]