2013年10月10日星期四

reported a tar backup crontab exception error

crontab command is as follows
0 2 *** tar czvf / home/backup/apache-tomcat6 `date +% y% m% d`. tar.gz / usr / local/apache-tomcat-6.0.37 && find / home / backup-name "apache *"-type f-mtime +7 | xargs rm -rf
command is run correctly , the problem is to add crontab character after being given , the error log is as follows
Subject: Cron tar czvf / home/backup/apache-tomcat6 `date +
Content-Type: text / plain; charset = ISO-8859-1
Auto-Submitted: auto-generated
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
X-Cron-Env:
Message-Id: <20131009060001.A403698DA @ test11g.localdomain>
Date: Wed, 9 Oct 2013 02:00:01 -0400 (EDT)

/ bin / sh:-c: line 0: unexpected EOF while looking for matching `` '
/ bin / sh:-c: line 1: syntax error: unexpected end of file
tune for a long time too.
------ Solution ---------------------------------------- ----
percent need to escape
http://bbs.chinaunix.net/viewthread.php?tid=674903 # pid4559830
------ Solution ------------------------------------ --------
and I think regular packaged and delete the file before this operation, write a script to determine what , it is quite a bit more secure .
------ For reference only -------------------------------------- -
tar czvf / home/backup/apache-tomcat6 $ `date +% y% m% d`. tar.gz
find / home / backup-name "apache *"-type f-mtime +7 | xargs rm-rf {} \;

------ For reference only ---------------------------------- -----
normal after using the escape character .

没有评论:

发表评论