Solved

Append Date/Time stamp to CRON job

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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ā€¦
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

757 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

16 Experts available now in Live!

Get 1:1 Help Now