Reputation: 85
I want to edit the crontab
of root
from the web interface. I have Apache
and PHP
installed on my Ubuntu
. If there is any permissions required please also mention that.
I want to edit the crontab of root. I have some jobs running in that crontab. One of my projects wants me to change the running jobs Time from web interface.
So please tell me how can I access the crontab of root and edit it.
Upvotes: 0
Views: 3471
Reputation: 10355
These days there are tools like
Upvotes: 0
Reputation: 6854
permission problems: solve those by allowing www-data
to run the appropriate commands via sudo
.
run crontab -u root -l
to get the current crontab, edit it with php string manipulation code of your liking and intall it with crontab -u root $FILE
. i recommend to place markers in the file to make it easier to find the correct places to edit like so:
# Edit this file to introduce tasks to be run by cron.
# ...
# m h dom mon dow command
0 14 27 * * backupmails-monthly.sh
0 14 * * 5 backupmails-weekly.sh
# MARKER_EDIT_HERE_START
0 14 27 * * job_to_edit.sh
# MARKER_EDIT_HERE_END
a better solution if jobs run regularly: don't put them in the crontab but in /etc/cron/cron.{hourly,daily}
.
Upvotes: 1
Reputation: 51
if you have access to the console, you should install webmin for web management interface of the server
Upvotes: 0