I use this
cron job to do a backup of
/home/blah/ each day at 01:00 a.m. :
0 1 * * * tar -zcf /home/blah/backup.tgz /home/blah/
In fact I would prefer that an email is sent to me with the .tgz file as attachment. (yes, the filesize will always be < 5 MB because my folder is very small)
Can I do something like :
0 1 * * * mail -s "Backup blah" "firstname.lastname@example.org" --attachment=(tar -zcf /home/blah/backup.tgz /home/blah/)
(this is pseudo-code at the end) inside the cron job ? What cron syntax should I use?