cron help
Ok I have a cron backup running every day at 12 but when I type crontab -l it says I have no crons schedulded so how do i view what crons are running and modify them? it is def running at 12 everyday.
|
crontab -l will list the current users cron jobs. if you have added to /etc/crontab or the common subdirectory structure in /etc/ then these will not show up. how did you configure this job in the first place? to change it just do the same again...
|
i didn't it was someone else, who is not around so any ideas?
|
crontab -e will put you in edit mode so you can see what jobs are there and make changes etc
Do you know which user the job is running under? If it's root doing the above command as root will show up root's jobs You might also want to look at /etc/cron.* dirs ie cron.daily/ cron.hourly/ cron.monthly/ cron.weekly/ |
I've no idea I tried both crontab -l for both the a/c the guy who set it up had and as root and it said both times that there was no crontab set up
|
Setting up a cron job as user fred
First, I'll set up a little diddy to test my script and make sure crontab is working. For quick testing, I tell cron to run it every minute and that will be changed for my real backup cron. For example: Code:
#!/bin/bash chmod +x /home/fred/backup.job I use the vi editor export EDITOR=vi Use this command to set the crontab file as being /etc/crontab crontab /etc/crontab Edit the crontab to include your script. You could also put the script in one of the /etc/cron folders crontab -e Code:
SHELL=/bin/bash Code:
su - -c "service crond restart" For example: Code:
#!/bin/bash Add a line to your personal crontab..... 00 23 * * * /mnt/backup/backup.job Don't forget that root needs to restart the crond. |
Quote:
|
All times are GMT -5. The time now is 07:16 AM. |