Solved

Append Date/Time stamp to CRON job

Posted on 2011-03-14
2
1,115 Views
Last Modified: 2012-05-11
How can I add a datetime stamp to my cron job?

mysqldump -u root -ppassword forumdb | gzip -c > /home/domain/public_html/_db_backups/forumdb.sql.gz
0
Comment
Question by:N R
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 35128641
mysqldump -u root -ppassword forumdb | gzip -c > /home/domain/public_html/_db_backups/$(date "+%Y%M%d%H%m").forumdb.sql.gz

will give e.g. /home/domain/public_html/_db_backups/201105141203.forumdb.sql.gz


wmp

0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35128661
Sorry, typo - interchange "M" and "m"!

mysqldump -u root -ppassword forumdb | gzip -c > /home/domain/public_html/_db_backups/$(date "+%Y%m%d%H%M").forumdb.sql.gz

wmp
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question