Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up cron job on CentOS

I don't know how to set up cron with ssh? I opened ssh and typed "crontab -e". What do I do then? I want to repeat the function every minute. I have this code as "cron command to run": php -f /var/www/vhosts/nf-test-host.tk/httpdocs/admin/cron/cron.php.

I am on CentOS. What should I do, exactly? Thanks in advance!

like image 737
Velid Vrabac Avatar asked Feb 04 '13 19:02

Velid Vrabac


People also ask

Where are cron jobs in CentOS?

On CentOS, Redhat and Amazon Linux cron logs are written to /var/log/cron . You will likely require root/sudo privileges to access your cron logs.

Where is crontab CentOS 7?

Crontab Working: Crontabs can be found in the local directory, such as in “/var/spool” or “/var/spool/cron/crontabs”, which is its sub-directory.

What does 30 * * * * mean in crontab?

*/30 * * * * your_command. this means "run when the minute of each hour is evenly divisible by 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc) example #3. 0,30 * * * * your_command. this means "run when the minute of each hour is 0 or 30" (would run at: 1:30, 2:00, 2:30, 3:00, etc)


1 Answers

You can try out different timing values in the crontab sandbox. It will show you a list of run times. www.dataphyx.com/cronsandbox/.

like image 66
mlbx02 Avatar answered Oct 09 '22 18:10

mlbx02