tags:

views:

46

answers:

2

Hi there!

I would like to add a crontab schedule by doing this in my server:

echo "30 * * * * /home/my/var/dir/to/script /var/etc/etc/etc/" > crontab -e

Is there a way to do this without going doing crontab -e and then typing in the command?

A: 

like root:

 echo "30 * * * * /home/my/var/dir/to/script /var/etc/etc/etc/" > /var/spool/cron/crontabs/username
diegueus9
+1  A: 

Could try

1)nano /etc/crontab (or any other editor, e.g. emacs)
2)echo "30 * * * * /home/my/var/dir/to/script /var/etc/etc/etc/" > /etc/crontab
3)or put the contents of this into a file, then do "file > /etc/crontab"
_NT
this is not right, you can break the system jobs.
diegueus9
i was also thinking about reading a file
Harry
but try dont write in /etc/crontab is dangerous!
diegueus9
It should be OK, if you're careful...
Scooterville