0

I have a cron job that is just running rsync on a particular directory.

When I run the rsync command itself sudo rsync -av --delete /directory1 /directory2, it runs without issue and does exactly as intended.

When the Cron job runs - I see it in /var/log/syslog.1 and it says this (summarized):

Mar  12 11:38:01 ip-xx-xx-xx-xxx CRON[4970]: (root) CMD (rsync --delete /my/directory /backup/directory)
Mar  12 11:38:01 ip-xx-xx-xx-xxx CRON[4970]: (CRON) info (No MTA installed, discarding output)

But the files are not in the backup directory (so it's not completing).

Does that second statement about 'No MTA installed' prevent the completion of the cron job? What is the best way to get that cron job to complete and get rid of the MTA error?

I found this answer but it doesn't say if that prevents the job from finishing.

Hanny
  • 101

1 Answers1

0

The cron should run even if its showing this warning. You can test this by placing a test file and see if its being copied to destination when cron is executed.

May I know if the cron is set using "crontab -e"? Try to add the cronjob not to crontab -e but to /etc/crontab. This should fix the statement about 'No MTA installed'.

Have you written the script to send email alerts? The warning, "(No MTA installed, discarding output)", happens when a mail service is not installed.

Most Linux distributions have a mail service (including an MTA) installed. Ubuntu doesn't though.

You can install a mail service, postfix for example, to solve this problem.

sudo apt-get install postfix