First Timer Cron user

Ch3vr0n

Verified User
Joined
Aug 24, 2014
Messages
88
So i'd like to set up my first cron task. If tried the site documentation, i used the search but couldn't find an immediate answer.

Say i wanted to execute the following task /home/accountname/domains/domain.tld/public_html/foldername/cli/filename.php every 3rd day of the month at 02.00hrs

1) what would the proper command be and timevalues be. I couldn't find any explanation at what * exactly means
2) is /usr/local/bin/php adding absolutely needed or would the command be executed without it aswell?
 
ok so the time setting would be

0 2 * * 3(or 1-7 for every day)

that does not answer 2 though
 
PHP scripts in cron can be executed 3 ways (at least). I don't know your script so you need to check it with your PHP-programmer or documentation for a PHP application you are using there.
 
0 2 * * 3(or 1-7 for every day)
This would execute your cronjob every Wednesday. Is that what you want?

Or do you wnt to do the backup every three days? To do the backup every three days use:
Code:
0 2 */3 * *
.

I'd recommend using the full path to php to call it as I've seen situations when it didn't work without the full path.

Jeff
 
shouldnt need any more than this

if its in a folder called 'cli'
php /home/USERNAME/domains/YOURDOMAIN.com/public_html/cli/akeeba-backup.php>/dev/null 2>&1
( this will prevent the email from being sent, leave off if you want to be notified that the cron ran >/dev/null 2>&1 )

replace USERNAME with your user name
replace YOURDOMAIN.com with your actual domain name


0 2 3 * *
Minute - Hour - Day of month - Month - Day of the week
if Im not mistaken, will be every 3rd day of each month at 2AM
 
Back
Top