-->
🏠 🔍
SHAREOLITE

Beginners Windows DOS Batch script to Backup and FTP to remote system

Ever wondered of customizing a simple Windows DOS batch script for storing the required files and FTP ing to a remote system for redundant backups. Below mentioned is one such script which can be used to backup required folders and transfer to remote backup system and save some penny spent for such basic purpose tools.

Copy the below code highlighted in blue in a .bat file. Double click or execute this in windows command line. Script can be run periodically in task scheduler.

Change the serverIP serverusername serverpassword and the destination folder values as per your requirement. The program uses a alzip - a open source zip utility  which supports command line backup options - it can be downloaded here.

d:
cd Systembackup
del Full-Backup-%day%.zip
c:
cd "C:\Program Files\ESTsoft\AlZip\"
alzip.exe -a "C:\Folder1","C:\Folder2" "D:\SystemBackup\Full-Backup-%day%.zip"
d:
cd Systembackup
del ftpscript.bat
echo open serverIP>> ftpscript.bat
echo serverusername>> ftpscript.bat
echo serverpassword>> ftpscript.bat
echo cd destinationfolder>>ftpscript.bat
echo delete Full-Backup-%day%.zip>> ftpscript.bat
echo put Full-Backup-%day%.zip>> ftpscript.bat
echo close>> ftpscript.bat
echo quit>> ftpscript.bat
ftp -s:ftpscript.bat
exit

Hope this is useful to some windows scripts beginners and enthusiasts.
Comments

–>