LinuxQuestions.org
Review your favorite Linux distribution.
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, 10: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, 10:13 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

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

Original Poster
Rep: Reputation: 15
thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:45 AM
Timestamp Help jch02140 Linux - Newbie 7 03-17-2006 03:33 AM
Timestamp inconsistencies J.W. LQ Suggestions & Feedback 3 03-07-2005 05:47 PM
adding date timestamp to filename markraem Solaris / OpenSolaris 2 11-17-2004 09:32 AM
Compilation Timestamp gr33ndata Programming 3 10-16-2004 06:00 PM

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

All times are GMT -5. The time now is 09:03 PM.

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