aarelovich
aarelovich

Reputation: 5566

Crontab command not outputting any log

I've been reading this great post:

https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it

And I decided to modify a line of my cron task to output my echos and any problems it might encouter. My cron tab line looks like this:

30 08 * * * /root/scripts_server/backup_daily.sh &>/var/log/bkp_daily.log

The script runs correctly (I can confirm that the backups were made and transfered) and the output file is created (bkp_daily.log), but it is empty.

Can any one point out a problem?

EDIT:

This is an example of a line in the script:

echo "--------------Sincronización de git remotos a locales-----------------------"

Upvotes: 0

Views: 81

Answers (1)

Barmar
Barmar

Reputation: 781088

I think &> is a bash extension, try using the standard shell syntax:

30 08 * * * /root/scripts_server/backup_daily.sh >/var/log/bkp_daily.log 2>&1

Upvotes: 2

Related Questions