I am trying to create hourly backups using a makefile, which uses rsync internally. (* */1 * * * backup.sh). Backup.sh is in my home folder. The reason I'm using a makefile is because I also do a backup on my portable disk apart from my remote server, and using a makefile enables me not to rewrite the same script again.

The problem is: The makefile is unable to run when called from cron. Cron and makefile, when called individually, works like a charm. But the whole thing doesn't work as a unit. Since the cron would run at the backend, I have put silent/quiet modes for make/rsync. But even that doesn't solve the problem.

Any help would be appreciated.

Thanks in advance, Royzz

link|improve this question
1  
Your description is too vague. Please provide error messages or the email cron sends you when the job produces output. Wild guess: some environment variables are missing. A cron job has almost an empty environment. If you can run your cronjob with env -i ./script.sh then you're ready for cron. – Jens Aug 29 '11 at 12:14
feedback

migrated from stackoverflow.com Aug 29 '11 at 17:22

This question came from our site for professional and enthusiast programmers.

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown