-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Crunz version: 3.7.0
PHP version: 8.1
Operating system type and version: Ubuntu
Description
I have a backup task that looks like so:
// backup task
echo "running task: Backing up database\n";
$task = $schedule->run("$jobs/mysqlbackup3.sh");
$task->daily()->at('01:30')
->description('Backing up database')
->sendOutputTo("$logs/mysqlbackup3.log")
->after(function () {
global $logs;
// email log to us
mail('eric@inc.com', 'MySql Backup', file_get_contents("$logs/mysqlbackup3.log"), [], '-fcron@inc.com');
});
It works properly but the body of the email is always blank. I can see the file on the server with the proper contents so it gets created. I suspect the log file has not been written to disk yet at the time of the after() call. Perhaps there is another way to mail me the output? I don't think it's related to the job being a shell script.
How to reproduce
see above
Metadata
Metadata
Assignees
Labels
No labels