The following works as expected:
date + '% d-% b-% Y-% H-% M'
28-Sep-2009-14-28
But none of the following 4 records of crontab work.
* * * * * date + \ '% d-% b-% Y-% H-% M \' >> /backup/shantanu/testing.txt
* * * * * date + '% d-% b-% Y-% H-% M' >> /backup/shantanu/testing1.txt
* * * * * date + "% d-% b-% Y-% H-% M" >> /backup/shantanu/testing2.txt
* * * * * date + \ "% d-% b-% Y-% H-% M \" >> /backup/shantanu/testing3.txt
Error:
/ bin / sh: -c: line 0: unexpected EOF while looking for matching `` '
/ bin / sh: -c: line 1: syntax error: unexpected end of file
I can save the same code in a shell script and install cron, but I will be interested to know if it is possible to directly install cron for the task.
The actual cron entry I'm trying to install looks something like this:
16 * * * * mysqldump myDB myTB> / backup / ABCbc $ (date + '% d-% b-% Y-% H-% M'). Sql 2> / backup / ABCbc_errORS $ (date + '% d- % b-% Y-% H-% M '). txt
unix cron
shantanuo
source share