[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

Need Batch file to create rolling backups of user specified files

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
Abacustechnologies
Asked:
Abacustechnologies
  • 4
1 Solution
 
For-SoftCommented:
What OS are you using?
0
 
For-SoftCommented:
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
 
AbacustechnologiesAuthor Commented:
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
 
For-SoftCommented:
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
 
For-SoftCommented:
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now