How to implement automatic backup in WinRAR (I)-Example of backing up a VC ++ Project

Source: Internet
Author: User
Since I started using WinRAR for backup, I always select the directory to be backed up and right-click to back up to the specified file. If there are large directories and files (such as the DEBUG directory and. NCB file), you need to put them in the recycle bin first. This is obviously cumbersome and inefficient, especially not suitable for daily backup. But I still stick to the above method for several years.
During this time, I suddenly wanted to solve the backup problem, so I checked the information online and checked the WinRAR help file. The general solution is as follows:
1. Create a "backup file list ". Name of all files and directories to be backed up.
2. Create a shortcut pointing to the absolute path of WinRAR and add the name line parameter.
3. Check the Help file. You can also specify a "ignore file list" to specify which files do not need to be backed up.

This solution is feasible. After these steps are completed, the backup efficiency can be improved. I did not do this for the following reasons.
1. When the project is very large, especially when there are multiple solutions and each solution has multiple projects, many directories and files need to be backed up, in addition, many directories and files need to be ignored. It is cumbersome to manually create a "backup file list" and "ignore file list.
2. WinRAR has many command line parameters and always needs to view the Help File during configuration.

In the next article, I will recommend two self-made script files, one for automatically generating the "backup file list" and "ignore file list", and the other for constructing WinRAR command line parameters, start the WinRAR backup process. However, here we take a VC ++ project as an example to see what the "backup file list" and "ignore file list" are, and how to configure WinRAR command line parameters.
1. assume that we have a mail directory that contains all source code, resources, and result files. The structure is as follows:
------ + Mail
------------- + Code
--------------------- + Recv code
----------------------------- + Debug
----------------------------- + Release
------------------------------ Recv. NCB
----------------------------- Other code files
--------------------- Send code
----------------------------- + Debug
----------------------------- + Release
------------------------------ Send. NCB
----------------------------- Other code files
------------- + Resource
--------------------- + Help
--------------------- + Images
--------------------- + Other files
------------- + Result (put the compiled file into this directory)
---------------------+Recv.exe
--------------------- + Recv. PDB
--------------------- + Recv. ilk
---------------------Mongosend.exe
--------------------- + Send. PDB
--------------------- + Send. ilk
--------------------- Other files

2. We need to back up the entire mail directory, but the debug/release directory should be ignored, and the. NCB/. PDB/. ilk file should be ignored. The following is a specific list.
1)" (list_append.txt ):
Mail // only one row.
2)upload the upload key (list_ignore.txt ):
Mail/code/Recv code/debug
Mail/code/Recv code/release
Mail/code/Recv. NCB
Mail/code/send code/debug
Mail/code/send code/release
Mail/code/send. NCB
Mail/result/Recv. PDB
Mail/result/Recv. ilk
Mail/result/send. PDB
Mail/result/send. ilk

3. Assume that the absolute path of the mail directory is: e:/pimshell/mail, then the WinRAR Command Behavior:
"C:/program files/WinRAR/winrar.exe" a-u-r "E:/pimshell/mail/mail.rar" @ backup file list-x @ ignore file list

A: compression is performed.
-U: Update backup
-R: Back up all subdirectories
"E:/pimshell/mail/mail.rar": target file

Other parameters are not commonly used. For more information, see the WinRAR help file.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.