Solved

Append Date/Time stamp to CRON job

Posted on 2011-03-14
2
1,096 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
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now