Solved

Append Date/Time stamp to CRON job

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

680 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