ARCHIVE FILES – ZIP FILES – MOVE IT TO FTP

OBJECTIVE IS TO ARCHIVE FILES, ZIP IT, FTP TO REMOTE AND THEN MOVE IT TO DIFFERENT FOLDER:
1. ARCHIVE FILES MEANS: MOVE THE FILES FROM SOURCE TO BACKUP FOLDER. THEREFORE, THE SOURCE FOLDER PATH DON’T HAVE THE FILES AFTER MOVING
2. ZIP USING 7Za (http://sourceforge.net/projects/sevenzip/)
2. FTP to Remote Server
3. Once FTP, Move it to Final Deletion Folder. Deletion folder means final stage for deletion of files based on the age, as we have backup those files to FTP.
Step I:
Move files older than 6 days from Any Server (In this Demo, we are moving mails. Moving means copy into the destination folder and delete from source folder) and Zip Files
robocopy “C:Program FilesMail EnablePostofficescompanymailrootWilkinson.JoseInbox” “C:backup-mayWilkinson.Jose” *.MAI /s /MOV /minage:6
Cd C:backup-mayWilkinson.Jose
7za a -tzip -mx3 C:backup-mayWilkinson.Jose.zip
del C:backup-mayWilkinson.Jose*.MAI
cd..
Cd C:backup-mayGeorge.King
7za a -tzip -mx3 C:backup-mayGeorge.King.zip
del C:backup-mayGeorge.King*.MAI
Step 11:
Create one text file and name it as ‘ftpcmd.txt’
Inside the file, you need to write your ftp login credentials.
1) Open FTP IP address
2) Username for FTP
3) Password for FTP
4) Type bin to set the file transfer type to binary
5) change the working directory on the remote computer
6) copy all files of a type @SourceFile from @SourcePath into @FTPPath
7) End the FTP session with the remote computer and exit ftp
open 10.0.0.122
username
password
bin
cd /SCN
mput D:mailbackup*.rar
quit
Step III:
Copy files to FTP and Move to Different Folder
Once the above file ‘ftcmd.txt’ is ready, we have to create one batch file with any name that you are going to schedule.
D:
Cd D:ImpFTP
ftp -i -s:D:ImpFTPftpcmd.txt
move /y D:mailbackup*.rar D:mailbackupmoved
exit

Leave a comment