LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-05-2003, 09:06 AM   #1
niehls
Member
 
Registered: Jun 2002
Location: Sweden
Distribution: slack, redhat
Posts: 91

Rep: Reputation: 15
adding timestamp to name


was thinking of making a very easy backup thingy to backup a single directory.
i'll make a simple cron script like this

cp <directory> /mnt/hdd2/backup/ -R

now, my question is: is there any way of adding a timestamp to the destination name? like <dest.directory><current date> ?
 
Old 12-05-2003, 09:13 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
just add `date format here, see manpage` INCLUDING backticks to the filename
 
Old 12-05-2003, 10:40 AM   #3
niehls
Member
 
Registered: Jun 2002
Location: Sweden
Distribution: slack, redhat
Posts: 91

Original Poster
Rep: Reputation: 15
thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
timestamp in the future comprookie2000 Linux - General 5 05-19-2011 05:45 AM
Timestamp Help jch02140 Linux - Newbie 7 03-17-2006 02:33 AM
Timestamp inconsistencies J.W. LQ Suggestions & Feedback 3 03-07-2005 04:47 PM
adding date timestamp to filename markraem Solaris / OpenSolaris 2 11-17-2004 08:32 AM
Compilation Timestamp gr33ndata Programming 3 10-16-2004 05:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration