Simon Chapman wrote:
I want to mail a file to someone from a cronjob. How would I do that?
It's a cronjob starting every day at 00:00, creating a backup file. After the backup, I want to mail the created file to myself (on another host).
I've got a couple of similar things running at work. Assuming the file is in /home/rogier and it goes to you at 01:01am, try this:
01 01 * * 1 root cat /home/rogier/backup | sendmail -f rogier@host.whatever icarus@guldernet.nl
What does the command 'root' do? (root cat /home/rogier/backup) Currently, I have this in my crontab: 0 0 * * * /home/rogier/backup >/dev/null 2>/dev/null I could make that into: 0 0 * * * /home/rogier/backup >/dev/null 2>/dev/null; cat backup | sendmail -f backup@host icarus@guldennet.nl If I cat the backupfile, wouldn't that leave me with a mail full of rubbish instead of a mail with the file as an attachment? Rogier -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/