How to get Cron to open terminal and Run command?

How to get Cron to open terminal and Run command?

From looking online, it looks as if cron commands can be chained with &&: 0 23 * * * open -a Terminal && echo ‘Hello, world!’ However, this modified cron job only opens Terminal without running the second command there. Any thoughts on how I can get the cron job to do both?

How to detect error in cron jobs Ubuntu?

Alternate ways According to this answer one can get errors of a cronjob in a log file using redirection. But you need to set the redirection with your cron job and specify the log file by yourself. And the /var/log/syslog file is always there to check if your cron job is running as you expected or not.

Is there a way to schedule tasks in Cron?

You can add any number of scheduled tasks, one per line. Once you have finished adding tasks, save the file and exit. The cron daemon will read and execute the instructions provided. Remember, Cron does not need to be restarted to apply changes.

What happens when I send a cron job?

That mail contains the description of a successful job or the detailed report why the particular cron job failed. If your local mail system is not set you will not receive those mails. The cron job output emails will just die in a local mail spool folder.

Can you change the output of a cronjob?

Anything i need to change in my cronjob . You can’t do this. All cron jobs are run in non-interactive shells, there is no terminal attachment. Hence the concept of /dev/tty or similar is not available in cron. The dirty way could be to redirect the output of your program to the pts file of an already existing terminal.

Are there any non interactive shells in Cron?

All cron jobs are run in non-interactive shells, there is no terminal attachment. Hence the concept of /dev/tty or similar is not available in cron. The dirty way could be to redirect the output of your program to the pts file of an already existing terminal.

How to run the second command in the terminal?

The following answer [after the separator] assumes that you want to run the second command within [inside] the Terminal. Otherwise you just need to swap the commands on your cronjob (because currently, as you have it, the echo will only execute after Terminal exits), such as: