LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-23-2012, 08:44 PM   #16
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947

Quote:
Originally Posted by AnanthaP View Post
for

I prefer
since it retains the original time stamp on the backed up - original - file (/etc/fstab.<YYYYMMDD>) and is useful to restore back if needed.

OK
You could always just add a "-a" to your cp.
 
Old 09-24-2012, 06:36 AM   #17
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
In any case, putting the date (and time if you want) into the filename means its retained no matter how often it gets copied or moved... and enables you to have multiple copies ie a history of changes.
 
Old 09-24-2012, 06:42 AM   #18
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Hi. I actually made a blog post about this. Please check it.

http://www.linuxquestions.org/questi...v-paths-35010/

I hope you find it useful
If you have questions about the script, you could still make a reply here so that others would know.
 
Old 09-24-2012, 08:26 PM   #19
ButterSideUp
LQ Newbie
 
Registered: Sep 2012
Location: Holywood
Distribution: RHEL
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks everybody, really helpful!
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to extract from a string Owais.Ahmad Linux - Newbie 13 07-27-2012 07:13 AM
extract a string within a string using a pattern adshocker Linux - Newbie 1 11-04-2010 11:44 PM
Extract value from string ewingtux Programming 1 12-27-2008 08:19 PM
Help: removing a variable substring from a string variable in sh script gnparsons Programming 2 06-04-2008 06:21 PM
extract string from file to variable [BASH] NikosNL Programming 13 05-07-2008 10:43 AM


All times are GMT -5. The time now is 04:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration