Solved

Append Date/Time stamp to CRON job

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

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