Crontab

Crontab  

List active cron jobs  

crontab -l
less /etc/crontab  

Systemctl restart crond    

View Cron Jobs by User
sudo crontab –u username –l  

How to List Hourly Cron Jobs
ls –la /etc/cron.hourly  

How to List Daily Cron Jobs
ls –la /etc/cron.daily  

How to Display Weekly Cron Jobs
ls –la /etc/cron.weekly  

How to List Monthly Cron Jobs
ls –la /etc/cron.monthly    

So the rule is always use full paths in crontab:  

22 10 * * * root /usr/bin/scp -i /home/username/.ssh/id_rsa -r /var/www/abc abc@ip:/home/abc  



Explanation of the Date/Time fields

The first five fields of the line are the date and time field which specify how frequently and when to execute a command. When adding the cron job in the DreamHost panel, the Date/Time is added for you automatically based on your 'When to run' setting.






Beoordeel deze vraag:

0 (0 Stemmen)

Verwante artikelen