Help/Backup/WTFBackup.bat
Norganna's AddOns sitesinden
Konu başlıkları |
Auto Backup your WTF folder
Since backing up the WTF folder should be done regulary it should be scheduled to take place once in a while.
The batch-file presented here is made for PC. For MAC-users the following wiki-page contains a similar tool: Mac-backup
WTFBackup Batch-file
To make this possible the following batch-file can be created:
if exist "<drive:>\<Program Files>\World of Warcraft\WTF\Backup\SavedVariables\" rd /s/q "<drive:>\<Program Files>\World of Warcraft\WTF\Backup\SavedVariables\" XCopy /y "<drive:>\<Program Files>\World of Warcraft\WTF\Account\<account>\SavedVariables\*.bak" "<drive:>\<Program Files>\World of Warcraft\WTF\Backup\SavedVariables\*.bak" XCopy /y "<drive:>\<Program Files>\World of Warcraft\WTF\Account\<account>\SavedVariables\*.lua" "<drive:>\<Program Files>\World of Warcraft\WTF\Account\<account>\SavedVariables\*.bak"
Since nobody use the same drive, main-folder and account the following items must be changed:
<drive:> The drive on which your copy of World of Warcraft is installed (e.g. N:);
<Program Files>: The folder in which your World of Warcraft folder is located (e.g. Games);
<account>: Your account-name (e.g. Nemelis).
What does the batch-file do
WTFBackup.bat first checks whether there exists a folder called Backup in the Account-folder. If so it is deleted (with all it contents). This is done to prevent possible problems with older files. If you don't want the batch-file to delete the Backup folder, delete the first line in the batch-file. Next it (re-)creates the Backup folder again. And then it copies the OLD backup files from the Account\<account>\SavedVariables folder to the Backup folder. And last it copies the current *.lua files to *.bak files in your Account\<account>\SavedVariables folder.
Important: Since windows does not see any difference between *.lua.bak and *.bak it creates even a *.bak file if copy a.lua a.lua.bak is used (or xcopy a.lua a.lua.bak). Therefor the batch-file uses copy a.lua a.bak (in this way it should be more clear that the created backups are called of type a.bak).
How to schedule
After you've saved the batch file as WTFBackup.bat in your World of Warcraft folder you can schedule it to run e.g. each week. To do this you need to take the following steps
1) Press Start;
2) Select the Control Panel;
3) Select "Scheduled Tasks";
4) Select "Add Scheduled Tasks";
5) Press Next;
6) Browse to your World of Warcraft folder and select WTFBackup.bat;
7) Give the task a different name if you want and select how often you want to perform this task (e.g. weekly, which I will use from here on) and press Next;
8) Select the time you want to start the backup (e.g. 3:30 am) and the day (e.g. wednesday for Europe, Tuesday for US (I use these times since then the backup takes place while WoW is down for maintenance)). And select how many weeks should be between the execution of this task (e.g. 1). Press Next;
9) Give your (windows) loginname and password (2x) and press Next;
10) Press Finish.