PC Review


Reply
Thread Tools Rate Thread

Backup batch file needed

 
 
Hans Näslund
Guest
Posts: n/a
 
      16th Aug 2006
I used to have a nice little batch file for my backup, which renamed
yesterday's backup from Backup to Backup1, and the backup from the day
before yesterday from Backup1 to Backup2, and then started the actual
backup.

The batch file was created with the help from some of the computer wizards
here, but silly enough I did not have a backup of it, so when I recently had
a disk crash, the batch file got lost.

May I ask the knowledgeful people here for some help to re-create such a
batch file again?

Hans


 
Reply With Quote
 
 
 
 
Badger
Guest
Posts: n/a
 
      16th Aug 2006
Do you know what program were you using to create the backups?

NTBackup?



"Hans Näslund" <(E-Mail Removed)> wrote in message
news:nHAEg.13353$(E-Mail Removed)...
>I used to have a nice little batch file for my backup, which renamed
> yesterday's backup from Backup to Backup1, and the backup from the day
> before yesterday from Backup1 to Backup2, and then started the actual
> backup.
>
> The batch file was created with the help from some of the computer wizards
> here, but silly enough I did not have a backup of it, so when I recently
> had
> a disk crash, the batch file got lost.
>
> May I ask the knowledgeful people here for some help to re-create such a
> batch file again?
>
> Hans
>
>



 
Reply With Quote
 
=?Utf-8?B?YUNrUmlUZQ==?=
Guest
Posts: n/a
 
      17th Aug 2006
Personally I would name the backups by date. It is completely up to you
though. Here is an example of how to set the current date and time into
variable if you choose. Let me know if you still want to use your original
way and I'll see what I can come up with for you...

*****lines that don’t begin with 2 space have wrapped accidentally*****

@echo off
setlocal
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set xdate=%%a-%%b-%%c
for /f "tokens=5-6 delims=:. " %%a in ('echo/^|time^|find "current"') do
set xtime=%%a-%%b
cls
echo.
echo Date - %xdate%
echo.
echo Time - %xtime%
echo.
endlocal
pause

*****lines that don’t begin with 2 space have wrapped accidentally*****

This script just shows you how to get the time and date into a variable. I’m
assuming you know a little about shell scripting to figure the rest out. If
not let me know and I will try to help you further...


"Hans Näslund" wrote:

> I used to have a nice little batch file for my backup, which renamed
> yesterday's backup from Backup to Backup1, and the backup from the day
> before yesterday from Backup1 to Backup2, and then started the actual
> backup.
>
> The batch file was created with the help from some of the computer wizards
> here, but silly enough I did not have a backup of it, so when I recently had
> a disk crash, the batch file got lost.
>
> May I ask the knowledgeful people here for some help to re-create such a
> batch file again?
>
> Hans
>
>
>

 
Reply With Quote
 
Hans Näslund
Guest
Posts: n/a
 
      18th Aug 2006
Thank you for your reply!

No, I don't want to name the backups by date. Long ago, I used to name them
by weekdays, but when the backups grew too large, my backup disk did not
have room enough for 7 backups, so now I don't want more than 3 backups at
one time.

So what I need is mainly a script for renaming the backups the way I
indicated.


"aCkRiTe" <(E-Mail Removed)> skrev i meddelandet
news:88402A8A-6B60-47C7-B441-(E-Mail Removed)...
> Personally I would name the backups by date. It is completely up to you
> though. Here is an example of how to set the current date and time into
> variable if you choose. Let me know if you still want to use your original
> way and I'll see what I can come up with for you...
>
> *****lines that don't begin with 2 space have wrapped accidentally*****
>
> @echo off
> setlocal
> for /f "tokens=2-4 delims=/ " %%a in ('date /t') do set

xdate=%%a-%%b-%%c
> for /f "tokens=5-6 delims=:. " %%a in ('echo/^|time^|find "current"') do
> set xtime=%%a-%%b
> cls
> echo.
> echo Date - %xdate%
> echo.
> echo Time - %xtime%
> echo.
> endlocal
> pause
>
> *****lines that don't begin with 2 space have wrapped accidentally*****
>
> This script just shows you how to get the time and date into a variable. I

'm
> assuming you know a little about shell scripting to figure the rest out.

If
> not let me know and I will try to help you further...
>
>
> "Hans Näslund" wrote:
>
> > I used to have a nice little batch file for my backup, which renamed
> > yesterday's backup from Backup to Backup1, and the backup from the day
> > before yesterday from Backup1 to Backup2, and then started the actual
> > backup.
> >
> > The batch file was created with the help from some of the computer

wizards
> > here, but silly enough I did not have a backup of it, so when I recently

had
> > a disk crash, the batch file got lost.
> >
> > May I ask the knowledgeful people here for some help to re-create such a
> > batch file again?
> >
> > Hans
> >
> >
> >



 
Reply With Quote
 
Hans Näslund
Guest
Posts: n/a
 
      18th Aug 2006
Yes, of course I do - it is BackupPlus, but that is not my issue. The point
for me is to find a simple way of renaming the backups the way I indicated.

"Badger" <(E-Mail Removed)> skrev i meddelandet
news:(E-Mail Removed)...
> Do you know what program were you using to create the backups?
>
> NTBackup?
>
>
>
> "Hans Näslund" <(E-Mail Removed)> wrote in message
> news:nHAEg.13353$(E-Mail Removed)...
> >I used to have a nice little batch file for my backup, which renamed
> > yesterday's backup from Backup to Backup1, and the backup from the day
> > before yesterday from Backup1 to Backup2, and then started the actual
> > backup.
> >
> > The batch file was created with the help from some of the computer

wizards
> > here, but silly enough I did not have a backup of it, so when I recently
> > had
> > a disk crash, the batch file got lost.
> >
> > May I ask the knowledgeful people here for some help to re-create such a
> > batch file again?
> >
> > Hans
> >
> >

>
>



 
Reply With Quote
 
Hans Näslund
Guest
Posts: n/a
 
      18th Aug 2006
I'm trying to find out myself how to do this now.The tricky thing seems to
be to get the renaming right. I have tried this script, but it does not
work - why?

@ECHO OFF
IF EXIST "E:\Normal backup.bac" REN "E:\Normal backup.bac" "E:\Normal
backup1.bac"
IF EXIST "E:\Normal backup.b02" REN "E:\Normal backup.b02" "E:\Normal
backup1.b02"
EXIT

"Hans Näslund" <(E-Mail Removed)> skrev i meddelandet
news:nHAEg.13353$(E-Mail Removed)...
> I used to have a nice little batch file for my backup, which renamed
> yesterday's backup from Backup to Backup1, and the backup from the day
> before yesterday from Backup1 to Backup2, and then started the actual
> backup.
>
> The batch file was created with the help from some of the computer wizards
> here, but silly enough I did not have a backup of it, so when I recently

had
> a disk crash, the batch file got lost.
>
> May I ask the knowledgeful people here for some help to re-create such a
> batch file again?
>
> Hans
>
>



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      18th Aug 2006
When you type

ren /?

then you can see the answer to your problem in the last line:

C:\Temp>ren /?
Renames a file or files.

RENAME [drive:][path]filename1 filename2.
REN [drive:][path]filename1 filename2.

Note that you cannot specify a new drive or path for your destination file.


"Hans Näslund" <(E-Mail Removed)> wrote in message
news:rOgFg.13623$(E-Mail Removed)...
> I'm trying to find out myself how to do this now.The tricky thing seems to
> be to get the renaming right. I have tried this script, but it does not
> work - why?
>
> @ECHO OFF
> IF EXIST "E:\Normal backup.bac" REN "E:\Normal backup.bac" "E:\Normal
> backup1.bac"
> IF EXIST "E:\Normal backup.b02" REN "E:\Normal backup.b02" "E:\Normal
> backup1.b02"
> EXIT
>
> "Hans Näslund" <(E-Mail Removed)> skrev i meddelandet
> news:nHAEg.13353$(E-Mail Removed)...
> > I used to have a nice little batch file for my backup, which renamed
> > yesterday's backup from Backup to Backup1, and the backup from the day
> > before yesterday from Backup1 to Backup2, and then started the actual
> > backup.
> >
> > The batch file was created with the help from some of the computer

wizards
> > here, but silly enough I did not have a backup of it, so when I recently

> had
> > a disk crash, the batch file got lost.
> >
> > May I ask the knowledgeful people here for some help to re-create such a
> > batch file again?
> >
> > Hans
> >
> >

>
>



 
Reply With Quote
 
=?Utf-8?B?YUNrUmlUZQ==?=
Guest
Posts: n/a
 
      18th Aug 2006
Try:

@ECHO OFF
IF EXIST "E:\Normal backup.bac" REN "E:\Normal backup.bac" backup1.bac
IF EXIST "E:\Normal backup.b02" REN "E:\Normal backup.b02" backup1.b02
EXIT



"Hans Näslund" wrote:

> I'm trying to find out myself how to do this now.The tricky thing seems to
> be to get the renaming right. I have tried this script, but it does not
> work - why?
>
> @ECHO OFF
> IF EXIST "E:\Normal backup.bac" REN "E:\Normal backup.bac" "E:\Normal
> backup1.bac"
> IF EXIST "E:\Normal backup.b02" REN "E:\Normal backup.b02" "E:\Normal
> backup1.b02"
> EXIT
>
> "Hans Näslund" <(E-Mail Removed)> skrev i meddelandet
> news:nHAEg.13353$(E-Mail Removed)...
> > I used to have a nice little batch file for my backup, which renamed
> > yesterday's backup from Backup to Backup1, and the backup from the day
> > before yesterday from Backup1 to Backup2, and then started the actual
> > backup.
> >
> > The batch file was created with the help from some of the computer wizards
> > here, but silly enough I did not have a backup of it, so when I recently

> had
> > a disk crash, the batch file got lost.
> >
> > May I ask the knowledgeful people here for some help to re-create such a
> > batch file again?
> >
> > Hans
> >
> >

>
>
>

 
Reply With Quote
 
Hans Näslund
Guest
Posts: n/a
 
      18th Aug 2006
Thanks a lot to Pegasus and aCkRiTe!

Now my batch file looks like this - and it works!

@ECHO OFF
IF EXIST "E:\Normal backup1.bac" REN "E:\Normal backup1.bac" "Normal
backup2.bac"
IF EXIST "E:\Normal backup1.b02" REN "E:\Normal backup1.b02" "Normal
backup2.b02"
IF EXIST "E:\Normal backup.bac" REN "E:\Normal backup.bac" "Normal
backup1.bac"
IF EXIST "E:\Normal backup.b02" REN "E:\Normal backup.b02" "Normal
backup1.b02"
START "C:\Program\Backup Plus\BackPlus.exe" "C:\Program\Backup Plus\Backup
Sets\Normal backup.bps"
EXIT



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file to backup to CD-RW Saycoda Windows XP General 1 16th Jul 2006 01:51 PM
XP Batch file needed for mapping Richard A Windows XP General 6 10th Jun 2004 03:20 AM
Backup Batch File Ron Boetger Windows XP General 7 7th Jun 2004 02:30 PM
help needed writing a batch file headtheball Windows XP General 1 22nd Feb 2004 09:36 AM
Batch File to backup? HeatherM Microsoft Access 2 8th Jan 2004 05:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:41 AM.