?
Solved

Need Batch file to create rolling backups of user specified files

Posted on 2004-08-11
7
Medium Priority
?
351 Views
Last Modified: 2012-06-27
Looking for a batch file that will create rolling backups of certain files or folders. For  example when the user clicks on an icon the batch file should run the backup routine. The backup routine backs up the files and folders listed in the file and lables the results Backup 1. When run again the same occurs however Backup 1 is renamed Backup 2 and the newest backup is named Backup 1. A maximum of 5 backups is created with the 6th bieng deleted when the total number of backups reaches 5. I'd like to be able to ammend the list of files and also to specify the location of the backups. Ability to direct backups to a network drive or second local drive is a bonus.
0
Comment
Question by:Abacustechnologies
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
7 Comments
 
LVL 10

Expert Comment

by:For-Soft
ID: 11775416
What OS are you using?
0
 
LVL 10

Expert Comment

by:For-Soft
ID: 11775563
This is the simplest solution I've found:

if exist backup5.zip rename backup5.zip backup6.zip
if exist backup4.zip rename backup4.zip backup5.zip
if exist backup3.zip rename backup3.zip backup4.zip
if exist backup2.zip rename backup2.zip backup3.zip
if exist backup1.zip rename backup1.zip backup2.zip
del backup6.zip
pkzip -r -p backup1.zip c:\temp\1\*.*
0
 

Author Comment

by:Abacustechnologies
ID: 11775711
Sorry All,  Forgot to mention OS is Windows 95 to XP.

Also, this batch file should, IMHO, consist of two parts. The first backs up the list of files and folders it contains while the second creates the actual backup file as well as renaming the backup as indicated by For-Soft.

Hope this clarifies things somewhat.

Dave
0
 
LVL 10

Expert Comment

by:For-Soft
ID: 11775912
It would be good to know, what backup metod should be used.
It is possible to use list file with pkzip compressor.
Arj is also capable of using list file.
0
 
LVL 10

Accepted Solution

by:
For-Soft earned 1600 total points
ID: 11776098
pkzip backup1.zip @list
or
arj a backup1.arj !list

---------------------- list
c:\temp\1\*.*
c:\temp\2\*.*
C:\temp\test.txt
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question