Remote FTP Backup

From ATI Chennai IT and ITES Wiki

Jump to: navigation, search

Contents

Windows Desktop/Server Push

  • Windows local file system
  • Linux/Windows remote FTP server
  • put / mput Transfer files from local to remote file system by FTP
  • get / mget Transfer files from remote to local file system by FTP

FTP Code File

To transfer the file from C:\Users\Admin\Desktop\Test\myfile.zip> to the /backupfolder in a remote FTP server we create a file , viz., u-nas.ftp in the same folder where our file to be transferred resides having the following text contents:

open <IP of FTP Server>
<FTP Username>
<FTP Password>
lcd /D "C:\Users\Admin\Desktop\Test\"
cd /backupfolder
binary
mput <file to be backed up - wildcards accepted>
disconnect
quit

Windows Batch File

Create a file zipftp.bat to zip up the set of files to be backed up (to a remote FTP server with the above credentials) having the following text contents:

SET MYFILE="myfile.zip"
IF EXIST %MYFILE% DEL /F %MYFILE%
 
"C:\Program Files\7-Zip\7z.exe" a -tzip %MYFILE% myfile.mdb
 
sleep 1
 
# A remote file is automatically overwritten when a local file that
# is PUT or MPUT has the same name as the remote file.
 
ftp -i -s:u-nas.ftp

References

Personal tools