RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Simple Backup Program for shards or webservers

crabby654

Wanderer
Simple Backup Program for shards or webservers

For anyone who is not fluent in basic command prompt coding, I created this little backup system for my server computer and thought I would share it. There are 2 files "backup1.bat" and "backup2.bat" and use these to schedule automatic backups of files.

This backup requires WinRar

Installation and Setup:
-Extract all the files to somewhere on your computer where you will not delete them.

-Open up backup1.bat with notepad, backup1.bat is the Copy file, what this file does is it copies your files to another hard drive. The reason it copies them to another hard drive or other storage device is because you can not backup programs that are currently in use. So if your RunUO Server is running you will not be able to back it up unless you copy it to another directory.

Once you have Backup1.bat opened up with notepad edit the line:
Code:
xcopy "C:\Documents and Settings\All Users\Documents\RunUO" "E:\ServerFiles\RunUO" /s/e/h/i/y

The first part "C:\Documents and Settings\All Users\Documents\RunUO" is the location of your RunUO directory, so enter in the correct path for that.

The "E:\ServerFiles\RunUO" part is the location of your destination directory of where you want them copied. If you want them copied correctly you first need to create the directory E:\ServerFiles\RunUO because it will not do it for you

-Once you have edited your Backup1.bat file open up your Backup2.bat file. Look at the line:
Code:
C:\Progra~1\winrar\winrar a -ag+MM-DD-YY E:\Backups\SotV\_SotV_Backup.rar E:\ServerFiles\RunUO

The C:\Progra~1\winrar\winrar line specifies where your WinRar.exe is.

The "-ag+MM-DD-YY " line adds a date to each .rar file that is created so it will look something like this: "08-22-06_SotV_Backup.rar"

Change "E:\Backups\SotV\_SotV_Backup.rar" to the destination of where you want your .rar backup file saved to. NO QUOTES IN THE CODE

Change "E:\ServerFiles\RunUO" to where your newly copied files went to. This destination is where your files are that you would like backed up.

Now in order to get this to run as a scheduled task, goto Start > All Programs > Accessories > System Tools > Scheduled Tasks, Once Sheduled Tasks is open, double click Add Scheduled Task. Click Next and when it shows you to choose a program click browse and select Backup1.bat and select how often you want it to run and then what time to run. After you have chosen a time to do it, do the same thing for Backup2.bat but make sure the time for Backup2.bat is atleast a half an hour after Backup1.bat is scheduled. This ensures that you will not backup files that arent copied yet or just so nothing bad happens.

Backup1.bat is not required. Backup1.bat is only for if you NEED to copy files that are running. If you wish not to use Backup1.bat, then only set Backup2.bat in the Scheduled Tasks.

And your all set!
 

Attachments

  • Backup.rar
    1.6 KB · Views: 121
Top