banacan Posted January 10, 2014 Share Posted January 10, 2014 I have my db backed up and emailed to me (the size of my db is small so email is not problem) using the following mysqldump command in a cron running weekly and it is working perfectly. mysqldump -e --user=username --password=password database | gzip | uuencode database_name.gz | mail me@domain.com All I want to do is add the current date of the backup to the gzip filename so each backup filename is unique. I have searched for the answer and found this suggestion: mysqldump -e --user=username --password=password database | gzip | uuencode $(date +%Y-%m-%d)-database_name.gz | mail me@domain.com But I get this error: unexpected EOF while looking for matching `)' I tried a different suggestion too: mysqldump -e --user=username --password=password database | gzip | uuencode `date +'%Y%m%d'`-database.gz | mail -s "`date +'%Y%m%d'`-database.gz mysqldump backup" me@domain.com But this also results in an error: unexpected EOF while looking for matching ``' I can't figure out why these solutions are causing errors nor how to fix it. Any suggested solutions would be welcome. Link to comment Share on other sites More sharing options...
Larry Posted January 15, 2014 Share Posted January 15, 2014 Yeesh. This is a good question, but outside of my own personal experience. I gather the problem is that uuencode is getting confused by what, exactly, it's supposed to encode. I'm not positive what the solution is, but I'd be inclined to first get the process working just outputting the file using the timestamped name. Then try to reintegrate the uuencode and email component. Link to comment Share on other sites More sharing options...
banacan Posted February 14, 2014 Author Share Posted February 14, 2014 Hi Larry, Thanks for replying. For some reason I did not get notified about your response which is why I'm just now seeing your post. I was hoping the Matthaus might chime in since he helped me once before with linux command line. Does anyone know how to reach him? Link to comment Share on other sites More sharing options...
Larry Posted February 15, 2014 Share Posted February 15, 2014 I do not know how to reach Matthaus. Link to comment Share on other sites More sharing options...
banacan Posted February 15, 2014 Author Share Posted February 15, 2014 Thanks Larry. Link to comment Share on other sites More sharing options...
Recommended Posts