SCP a file to diff directory/change filename using PHP or call sh script fm PHP
Hello all,
Been trying different things to no avail, would seem might be a simple fix...trying to just copy a file that will have a different filename every hour over to a generic filename already saved in a different directory to save over old data in the file using PHP script. Actually works when I run manually...but not when ran using crontab, not sure why other than maybe $remote_file doesn't have permissions or something and will only copy when I run it manually? Any simple fix for this?
Been trying to use the system command,
$copy = "scp /usr/local/$remote_file /usr/local/profiler/bby.txt";
system($copy);
Also tried calling a seperate shell_script
system(/usr/local/shell_scripts/send_file.sh $remote_file);
Then shell script has same command as above.
Any help appreciated! Thanks
|