SacAutos
Regular Pleskian
In another thread, I describe some software that I wrote in PHP to automatically export (via FTP) the backup tar files that Plesk is storing locally on my server (by pretending that it's actually a remote server). One issue that I was having is that sometimes it takes more than 24 hours for all the files to be uploaded to the remote cloud storage.
My response was to create a small file of the current process ID while the cron job was running. Then, at the start of the module, I check to see if that file exists. If it does, that process ID is collected and the php command exec("ps -p {$pid}") is used to determine whether that process is still active. If it is, then gracefully exit to prevent possible transfer duplications.
The testing went well interactively. But I'm getting an error returned when the process is run via cron:
sh: /ps: No such file or directory
What I gather from this is that the ps command (Process Status) appears to be unavailable in the cron shell.
Where do I go from here?? Is there some form of workaround to access ps via the right path? Or is there some other method I can use? Feeling stuck...
My response was to create a small file of the current process ID while the cron job was running. Then, at the start of the module, I check to see if that file exists. If it does, that process ID is collected and the php command exec("ps -p {$pid}") is used to determine whether that process is still active. If it is, then gracefully exit to prevent possible transfer duplications.
The testing went well interactively. But I'm getting an error returned when the process is run via cron:
sh: /ps: No such file or directory
What I gather from this is that the ps command (Process Status) appears to be unavailable in the cron shell.
Where do I go from here?? Is there some form of workaround to access ps via the right path? Or is there some other method I can use? Feeling stuck...