peppeocchi / php-cron-scheduler

PHP cron job scheduler
MIT License
811 stars 144 forks source link

Raw output not being saved to file #100

Closed GJMichael closed 4 years ago

GJMichael commented 4 years ago

Hi,

Not sure if this expected functionality, but I am unable to get any output saved to a log file when using the raw function with non-php commands. For example:

PHP command: This works and log file is created and has the expected output in it: $scheduler->raw('php /some/file.php')->at('1 *')->output('/some/file.log');

CURL command: This works and the log file is created, but it is empty: $scheduler->raw('curl -v ftp://site.co/file.zip --output /save/file.zip --ftp-ssl')->at('1 *')->output('/some/file2.log');

I'm unsure why the php command logs data but the curl command does not. The same happens with some gzip crons we run.

When running the curl and gzip commands via the crontab (which we want to move away from to this scheduler) we do get outputs emailed to us.

If anyone could fill me in with whats happening that would be great, I can provide more details if required.

GJMichael commented 4 years ago

Hi,

I'm closing this issue. To get the output working you just need to add " 2>&1" at the end of any non-php commands, and the output then makes it to the log file.