I am running a cronscript like:*/45 * * * * /path/to/php /path/to/file.phpit creates a file and put on home directory; But I want to create this file in my desired path like:*/45 * * * * /path/to/php /path/to/file.php /path/where/file/to/saveactually the file.php create file.xls and put it on home directory. I want to set path for file.xls should be created in some other directory.is there some way ?
How to set path in cronscript
shell script;files;cron
If the PHP script creates the file in the current directory, change to the desired output directory:*/45 * * * * cd /path/where/file/to/save && /path/to/php /path/to/file.phpIf the PHP script creates the file in your home directory, you might be able to pretend your home directory is elsewhere but if it also tries to read other files from your home directory, then it will also read these files from elsewhere.*/45 * * * * HOME=/path/where/file/to/save /path/to/php /path/to/file.php