Re: shell script to backup files with datestamp

2003-02-10 Thread Jack L. Stone
At 11:19 AM 2.10.2003 -0500, Dave [Hawk-Systems] wrote:
Without dumping to perl or another external language, would like to
accomplish
the following;

prior to making changes in a file, backup incrementially the current file to
create a record of changes ans versions.  For example.

we are about to make changes to file.conf  and would like to make a copy
of our
current file before doing so *without* overwriting previous backup copies

   #cp /path/to/file.conf /path/to/file.conf.20030210

I almost want to say this could be done with something simple like

   #cp /path/to/file.conf /path/to/file.conf.$DATE

which would be the solution if I was using perl, php, or soething else to
accomplish the copy of files, but would prefer a simple one liner without
having
to load another processor just for this one command.

Suggestions would be appreciated.

Dave


If you use date as follows, it will take it out to the month, day, hour
and minute

cp ../file.conf`date +.%m.%d.%H.%M`

...will give:
file.conf.02.06.04.45

Best regards,
Jack L. Stone,
Administrator

SageOne Net
http://www.sage-one.net
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: shell script to backup files with datestamp

2003-02-10 Thread Doug Poland

Jack L. Stone said:
 At 11:19 AM 2.10.2003 -0500, Dave [Hawk-Systems] wrote:
 Without dumping to perl or another external language, would like
 to accomplish the following;

 prior to making changes in a file, backup incrementially the
 current file to create a record of changes ans versions.  For
 example.

 we are about to make changes to file.conf  and would like to make
 a copy of our current file before doing so *without* overwriting
 previous backup copies

  #cp /path/to/file.conf /path/to/file.conf.20030210

 I almost want to say this could be done with something simple
 like

  #cp /path/to/file.conf /path/to/file.conf.$DATE

 which would be the solution if I was using perl, php, or soething
 else to accomplish the copy of files, but would prefer a simple
 one liner without having to load another processor just for this
 one command.

Suggestions would be appreciated.


 If you use date as follows, it will take it out to the month,
 day, hour and minute

 cp ../file.conf`date +.%m.%d.%H.%M`

 ...will give:
 file.conf.02.06.04.45

I suggest spending an hour or two learning RCS.  You'll have
history, rollback, tags, and much more with a real revision control
system.  RCS is not at all hard to learn with basic checkin (ci)
checkout (co)
and diff (rcsdiff) commands.  Any time you spend learning RCS will
help if you later have to move to CVS for a distributed solution.

-- 
Regards,
Doug



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



RE: shell script to backup files with datestamp

2003-02-10 Thread Dave [Hawk-Systems]
From: Doug Poland
Jack L. Stone said:
 At 11:19 AM 2.10.2003 -0500, Dave [Hawk-Systems] wrote:
 Without dumping to perl or another external language, would like
 to accomplish the following;
clip

 #cp /path/to/file.conf /path/to/file.conf.20030210

 I almost want to say this could be done with something simple
 like

 #cp /path/to/file.conf /path/to/file.conf.$DATE
clip

 If you use date as follows, it will take it out to the month,
 day, hour and minute

 cp ../file.conf`date +.%m.%d.%H.%M`

 ...will give:
 file.conf.02.06.04.45

I suggest spending an hour or two learning RCS.  You'll have
history, rollback, tags, and much more with a real revision control
system.  RCS is not at all hard to learn with basic checkin (ci)
checkout (co)
and diff (rcsdiff) commands.  Any time you spend learning RCS will
help if you later have to move to CVS for a distributed solution.

Thanks to both for the solutions...

The short-term fix by Jack is exactly what I was looking for...  but for long
term use I really like the potential that RCS has (was never aware that function
existed).  Will definately be spending some time with that and likely be moving
to that in the future.

Thanks again.

Dave



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message