• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 71
  • Last Modified:

Backup Script

I would like to create a backup of a folder(and its sub-folders) to a rar file

The rar file should be the same name as the one earlier. so it means that we need to re-fresh the files and add new files.
The rar file when done should be moved to a specific location.

Thank you
0
Pierre Ammoun
Asked:
Pierre Ammoun
  • 2
1 Solution
 
NVITCommented:
Notes:
- Adjust RarFile, TgtDir and LogFile to your needs
@echo off
setlocal
set RarFile=C:\test\test2.rar
set TgtDir=C:\MoveToThisFolder
set LogFile=%temp%\RarBackup.log
if not exist "%TgtDir%\" (
  echo Missing target folder >>"%LogFile%"
  echo Missing target folder & goto :eof
  ) else (
  rar u -r "%RarFile%" *
  move /y "%RarFile%" "%TgtDir%"
  echo Moved "%RarFile%" to "%TgtDir%" >>"%LogFile%"
)

Open in new window

0
 
Pierre AmmounAuthor Commented:
NewVillageIT Thanks for the script.

2 small notes:

1- the parameters u updates files in the archive. Does it mean that if new files are created the are also added to the archive ? I am confused about the parameter f (freshen files )
2-How can I create recovery volumes so that I am certain that the files will be extracted ?

3- How can I change the compression level ?

4-I need the logfile (so that I can make sure that the command executed to be store on a separate folder (dropbox folder)

Thanks a lot !
0
 
NVITCommented:
Hi pa66...

Do still need help with questions in your last post?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

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