I have to setup 4 crontabs to run 4 scripts every hour. Is this the corect way to set up one of the scripts? HTML: crontab 0 * * * * /var/www/web4/web/cronjobs/delete_cache_files.php
if you want to run php files by cron install the phpX-cli package and then I think the correct syntax is: Code: 0 * * * * php -f /var/www/web4/web/cronjobs/delete_cache_files.php and if you don't want any feedback: Code: 0 * * * * php -f /var/www/web4/web/cronjobs/delete_cache_files.php >/dev/null 2>&1 and actually I would add crons like this: (1) create a text file "cron.txt" (2) edit it to add the crontabs: Code: 0 * * * * php -f /var/www/web4/web/cronjobs/delete_cache_files.php >/dev/null 2>&1 15 * * * * php -f /var/www/web4/web/cronjobs/script2.php >/dev/null 2>&1 30 * * * * php -f /var/www/web4/web/cronjobs/script3.php >/dev/null 2>&1 45 * * * * php -f /var/www/web4/web/cronjobs/script4.php >/dev/null 2>&1 Or if it's the same script running every 15 min: Code: 0,15,30,45 * * * * php -f /var/www/web4/web/cronjobs/delete_cache_files.php >/dev/null 2>&1 (3) Save and exit the file (4) Run this command: Code: crontab /path/to/cron.txt (5) Check if it was added: Code: crontab -l I think managing cron with such a text file is simpler.
thanks for the crontab help That was nice and easy. I createdd the cron.txt and added the strings in there and then ran crontab /path/to/cron.txt. will they now run every hour around the clock? HTML: 0 * * * * php -f /var/www/web4/web/cronjobs/delete_cache_files.php >/dev/null 2>&1 0 * * * * php -f /var/www/web4/web/cronjobs/speeddater_email.php >/dev/nul 2>&1 0 * * * * php -f /var/www/web4/web/cronjobs/mship_expiry_reminder_mail.php >/dev/null 2>&1 0 * * * * php -f /var/www/web4/web/cronjobs/mymatches_email.php >/dev/null 2>&1
great Yes it worked great. I created the cron file and it is working. I can see them when I run the command crontab -l. dose that mean they are running if I can see them? can I add cronjobs to this file and they will be ran as well?
well, you could have sent yourself an email with the output of the cronjobs... if you want to add more crons, just edit the cron file and then do again: Code: crontab cron.txt to actualize it.
Can anyone tell me where the CROn error log is? I'm on Debian, and can't find it in /var/log. Thanks.
Still didn't find the error in the logs anywhere, but did get an email that the permissions were wrong! Rookie mistake!