Cron command

lockerz93lfe95

New Member
Messages
2
Reaction score
0
Points
0
Hello, Im new in using Cron. Could you tell me how to write a command which will open a file?(its not php file.)
 

vv.bbcc19

Community Advocate
Community Support
Messages
1,524
Reaction score
92
Points
48
If you want to open the file every sunday for example:This is for php file.This actually executes the code inside the php file.
* * * * Sun /usr/local/bin/php $HOME/filename.php >> $HOME/log/logforfilename.txt 2>&1
But if you want to just open a file,I donot understand a cause why would someone open a file just like that unless the file has to help the users cause some how.
Suppose it is any javascript/html file..
* * * * Sun /usr/local/bin/php $HOME/filename.html >> $HOME/log/logforfilename.txt 2>&1
 

lockerz93lfe95

New Member
Messages
2
Reaction score
0
Points
0
Where I should put this file, in main, not any folder?
Im used: Sun /usr/local/bin/php $HOME/test.php >> $HOME/log/logforfilename.txt 2>&1
And in php file script sending me email but its not working.;/
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
$HOME, in this case, translates into /home/YOURcPANELUSERNAME , not your public_html directory.

The cPanel email notification has been turned off.

Last time I checked, PHP mail() via cron does not work.
 
Top