B3AN Posted May 29, 2005 Share Posted May 29, 2005 (edited) Simple little backup script which will backup some files using winrar and upload them to a ftp server automatically. Some requirements 1.Install WinRAR (www.winrar.com) 2.Remote FTP Server ? Load up notepad and type the following: @ECHO OFF ? echo Please Wait...Backup in progress. ? >backup_list.script ECHO D:\ >>backup_list.script ECHO E:\Important ? ? The important parts are >backup_list.script ECHO D:\ and the line below. These lines will tell winrar which files to backup. ? >backup_list.script ECHO D:\ - Anything after the ECHO is printed to a file called ‘backup_list.script’. In this case D:\ (where my documents are). It is important for the first line to have a single ‘>’. This creates a new file. Add as many ‘>>’ lines as you want with all the paths you wish to backup. ? Next the exclusion lists. Winrar will backup ALL files with in the directories listed above, this is not always practical. Add any exclusions using the following commands: ? >backup_x_list.script ECHO D:\Do Not Backup Folder >>backup_x_list.script ECHO D:\Borland Studio Projects >>backup_x_list.script ECHO D:\System Volume Information >>backup_x_list.script ECHO D:\My PSP Files ? >>backup_x_list.script ECHO D:\desktop.ini >>backup_x_list.script ECHO D:\Default.rdp ? Remember the first line must have a single ‘>’. If adding a directory do not include a final slash. For files include the full path. ? Next the important part: ? "C:\Program Files\WinRAR\RAR.exe" a -hppassword -m5 -r E:\ \backup.rar @backup_list.script -t -x@backup_x_list.script ? This tells winrar to execute and create a new archive including and excluding the files listed above. The archived will be called ‘backup.rar’. The command ‘-hppassword’ adds a password to the archive for security, change password to something else eg. ‘-hpnewpassword’. ? Now upload the files to the web. ? echo Please Wait...Uploading Files. >script.ftp ECHO username >>script.ftp ECHO password >>script.ftp ECHO cd backup_folder/ >>script.ftp ECHO binary >>script.ftp ECHO prompt n >>script.ftp ECHO put backup.rar >>script.ftp ECHO quit ? Change username and password to the correct values. Change ‘CD backup_folder/’ to where ever you wish the file to be saved remotely. Remember to include the final slash. ? ? Next to connect the ftp site and run the script: ? FTP -v -s:script.ftp ftp.ftpsite.net ? Change ftp.ftpsite.net to your site. ? Delete the scripts: ? DEL script.ftp DEL backup_x_list.script DEL backup_list.script ? ?All done. Set up Scheduling using the built in Windows Scheduled Tasks application. Start->Settings->Control Panel->Scheduled Tasks->Add Scheduled Task and follow the wizard. I have mine to run every sunday night. My complete script: @ECHO OFF echo Please Wait...Backing Up Files. >backup_list.script ECHO D:\ >backup_x_list.script ECHO D:\Borland Studio Projects >>backup_x_list.script ECHO D:\Installed >>backup_x_list.script ECHO D:\Documents >>backup_x_list.script ECHO D:\System Volume Information >>backup_x_list.script ECHO D:\My PSP Files >>backup_x_list.script ECHO D:\desktop.ini >>backup_x_list.script ECHO D:\Default.rdp "C:\Program Files\WinRAR\RAR.exe" a -hpMYPASSWORD -m5 -r backup.rar @backup_list.script -t -x@backup_x_list.script echo Please Wait...Uploading Files. >script.ftp ECHO USERNAME >>script.ftp ECHO PASSWORD >>script.ftp ECHO cd backup/ >>script.ftp ECHO binary >>script.ftp ECHO prompt n >>script.ftp ECHO put backup.rar >>script.ftp ECHO quit FTP -v -s:script.ftp ftp.MYFTPSITE.net DEL script.ftp DEL backup_x_list.script DEL backup_list.script Echo Done..... I hope some people find this useful. Edited May 29, 2005 by B3AN Link to comment Share on other sites More sharing options...
martinsc Posted May 29, 2005 Share Posted May 29, 2005 thx (Y) i am sure some people could really need this guide Link to comment Share on other sites More sharing options...
B3AN Posted May 29, 2005 Author Share Posted May 29, 2005 Some files you may wish to backup. Opera Take a look at : Site Firefox %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\bookmarks.html %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\cert8.db %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\cookies.txt %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\prefs.js %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\signons.txt %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\key3.db %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\extensions\ Link to comment Share on other sites More sharing options...
hotrod1 Posted May 29, 2005 Share Posted May 29, 2005 Great guide. Thanks and I would use this but I only have a reseller account so I won't have enough space to do this. Link to comment Share on other sites More sharing options...
B3AN Posted May 29, 2005 Author Share Posted May 29, 2005 Yeah that is a problem for a large backup you do need alot of space. Before I got alot of ftp space I only used to backup important settings and files. Link to comment Share on other sites More sharing options...
Dom Posted May 30, 2005 Share Posted May 30, 2005 Really great, now to find an FTP with enough space :p Link to comment Share on other sites More sharing options...
.Atlantis Posted June 2, 2005 Share Posted June 2, 2005 Thanks ever so much, very useful Link to comment Share on other sites More sharing options...
Bhav Posted June 2, 2005 Share Posted June 2, 2005 thanks man. brilliant guide. Link to comment Share on other sites More sharing options...
Bhav Posted June 2, 2005 Share Posted June 2, 2005 Some files you may wish to backup.Opera Take a look at : Site Firefox %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\bookmarks.html %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\cert8.db %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\cookies.txt %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\prefs.js %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\signons.txt %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\key3.db %Appdata%\Mozilla\Firefox\Profiles\*YOUR PROFILE NAME*\extensions\ 585984940[/snapback] cheers for that too. almost forgot my bookmarks! Link to comment Share on other sites More sharing options...
Bhav Posted June 2, 2005 Share Posted June 2, 2005 (i know this is triple post, sorry). I need some help. This is what i have: @ECHO OFF echo Please Wait...Backup in progress. >backup_list.script ECHO C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\bookmarks.html >>backup_list.script ECHO C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\signons.txt >>>backup_list.script ECHO C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\prefs.js >>>>backup_list.script ECHO C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\cookies.txt "D:\Program Files\WinRAR\RAR.exe" a -hpeggs -m5 -r backup.rar @backup_list.script -t -x@backup_x_list.script echo Please Wait...Uploading Files. >script.ftp ECHO bhav >>script.ftp ECHO ****** >>script.ftp ECHO backup/ >>script.ftp ECHO binary >>script.ftp ECHO prompt n >>script.ftp ECHO put backup.rar >>script.ftp ECHO quit FTP -v -s:script.ftp ftp.******.com DEL script.ftp DEL backup_x_list.script DEL backup_list.script Echo Done..... but when i run the .bat, the command prompt window flashes (disappears very quickly), and i just get a file created in the same directory as the .bat called backup_list.script, which only says the following: C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\bookmarks.html C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\signons.txt Any idea what's wrong? (NB: winrar is installed on the D drive on my pc) Link to comment Share on other sites More sharing options...
hurting101 Posted June 2, 2005 Share Posted June 2, 2005 >>>backup_list.script ECHO C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\prefs.js>>>>backup_list.script ECHO C:\Documents and Settings\Shah\Application Data\Mozilla\Firefox\Profiles\0wnof4re.default\cookies.txt ... Any idea what's wrong? 586004857[/snapback] Only use >> for those lines, not >>> or >>>>. Link to comment Share on other sites More sharing options...
Bhav Posted June 2, 2005 Share Posted June 2, 2005 (edited) Only use >> for those lines, not >>> or >>>>. 586004995[/snapback] oh right i see. ok so the script has got a bit further this time. but now there's an error in command prompt. it says: Cannot open backup_x_list.scriptThe system cannot find the file specified then it tries to upload, but there's nothing to upload. edit: nevermind all sorted, just removed the bit about backup_x_list.script in the script. thanks for this script, and cheers for the help hurting101. Edited June 2, 2005 by Bhav Link to comment Share on other sites More sharing options...
Colin-uk Veteran Posted June 2, 2005 Veteran Share Posted June 2, 2005 very cool script :yes: Link to comment Share on other sites More sharing options...
fegul Posted June 2, 2005 Share Posted June 2, 2005 Thanks! I've been looking for something like this Link to comment Share on other sites More sharing options...
univn Posted June 9, 2005 Share Posted June 9, 2005 Your script so usefull ! But i can't connect to FTP server automatically I tried many times but it's always not success Please tell me Why ? and how can i do ? Link to comment Share on other sites More sharing options...
B3AN Posted June 9, 2005 Author Share Posted June 9, 2005 Your script so usefull !But i can't connect to FTP server automatically I tried many times but it's always not success Please tell me Why ? and how can i do ? 586038531[/snapback] What sort of errors are popping up? if any. Link to comment Share on other sites More sharing options...
Valerus Posted June 9, 2005 Share Posted June 9, 2005 awesome, thanks for the guide Link to comment Share on other sites More sharing options...
mpat1024 Posted June 14, 2005 Share Posted June 14, 2005 Nice, but I have 56k and make CD backups with an external USB CD-RW drive. Any way of adapting the sc Link to comment Share on other sites More sharing options...
Aqua Curve Posted June 15, 2005 Share Posted June 15, 2005 thanks man, awesome guide :yes: Link to comment Share on other sites More sharing options...
aaalert Posted June 15, 2005 Share Posted June 15, 2005 :) many thanks Link to comment Share on other sites More sharing options...
xxdesmus Posted June 15, 2005 Share Posted June 15, 2005 wow...very useful guide. thanks ;) Link to comment Share on other sites More sharing options...
cpu121 Posted June 15, 2005 Share Posted June 15, 2005 Nice, but I have 56k and make CD backups with an external USB CD-RW drive. Any way of adapting the sc 586065267[/snapback] I agree, is it possible for you to show us how to modify the script to back up to a another disk/partition/machine on the local network? Link to comment Share on other sites More sharing options...
oddcrap Posted June 16, 2005 Share Posted June 16, 2005 Useful, and unique! Link to comment Share on other sites More sharing options...
B3AN Posted June 16, 2005 Author Share Posted June 16, 2005 I agree, is it possible for you to show us how to modify the script to back up to a another disk/partition/machine on the local network? 586069186[/snapback] Well instead of the ftp section you could use the copy command for example: Network Drive: copy backupfile.rar \\network\share\backupfile.rar Normal Folder: copy backupfile.rar e:\Backups\backupfile.rar Link to comment Share on other sites More sharing options...
Recommended Posts