Automatically backup web server data with WinSCP via FTP
TipsMake.com - For website system administrators, data backup and recovery must always be the top priority. And in fact, there are many ways to do this applied daily. In the following article, we will show you how to do this with the free WinSCP tool and some basic knowledge of code.
In essence, the FTP protocol - File Transfer Protocol is a form of data transfer between many different computers. Formed and developed over a long time, FTP and SFTP - Secure File Transfer Protocol are still the most popular protocols in the world today. To apply for the test below, you need to prepare:
- Server FTP
- Computer using Windows operating system
- WinSCP version - for Windows
Set up WinSCP:
The first thing we need to do here is to install WinSCP on a Windows computer:
Then, you need to create a new one section profile to use in later sessions. At the Login screen, we enter the host name (eg ftp.howtogeek.com ), Username and Password , select FTP or SFTP , change the appropriate Port value. Then click Save to save this profile:
Create Script:
Here, we will create a simple code for the system to log in to the FTP server, communicate with WinSCP to download the missing files, then create a log file to record all FTP operations. To get started, open NotePad and copy the code below:
batch tùy chọn
tùy chọn confirm
open patrickbisch@ftp.howtogeek.com
cd backups
tùy chọn chuyển đổi binary
get / testremote * f: backupstestlocal *
synchronize local f: backupstestlocal testremote
exit
Specifically, WinSCP will automatically respond to system notifications to avoid interruption in the middle of operation, then overwrite newly created files. Continue, log in to the FTP server based on the profile created above, change the directory structure (if necessary), pass the binary code (as opposed to ASCII ). Finally, the application will filter the diagram, FTP directory structure on the remote server, and transfer the necessary files to the specified directory. You can refer here .
Before running or editing this script, you should create a test directory on local and remote computers (to avoid possible confusion). On the local machine, we create the testlocal directory (here is F: backups ) and testremote on the FTP server. Then, run the script, if successful, save the above code into any folder on your computer.
Set up automatic mode for scripts:
For the rest of the process, we'll let Windows do it - based on the built-in Task Scheduler feature. You open Control Panel> System and Security> Administrative Tools> Task Scheduler:
In the right window, click Create Basic Task:
Give a short name and description for this operation, click Next to continue:
The next option is the operation mode over time, in this test, we want the script to run every time the computer starts. So you choose When the computer starts:
On the next screen, select Start a program and click Next . The system will ask us to point the path to the file to be executed. Click the Browse button and point to C: Program FilesWinSCPWinSCP.exe . Below, you enter:
/ console /script=f:backupsync.txt /log=f:backuplog.txt
Change the details at this argument as appropriate
After that, the system will display all general information as well as details of the whole process, check again and click Finish . And to make sure the system will work as expected, you should click the Run button to make sure there are no errors arising:
Very simple and easy, wish you success!
You should read it
- Delete log information in Windows Server Backup
- How to use Iperius Backup Free to back up Windows data
- Instructions for using File History to backup and restore data
- How to backup data on iPhone or iPad
- 4 ways to manage the process of Backup Windows Server 2008 on multiple servers
- Install Windows Server Backup on Windows Server 2008 R2
- Things to keep in mind when backing up data on your computer
- Instructions for backing up all data on Android device without root
May be interested
- Why is encryption important for data backup?backing up your data is essential, but encrypting your files prevents unauthorized access. encryption converts files into unreadable data, ensuring that even if your backup is compromised, your sensitive information remains secure.
- Back up virtual machines with Windows Server 2008 R2 and Hyper-Vin this article we will not cover the basic principles of backing up virtual machines, instead we want to focus on backup methods using windows server backup.
- How to use Iperius Backup Free to back up Windows dataiperius backup free software supports backing up many types of data on the computer from images, image folders, file system to sql, oracle, mysql, postgresql databases.
- The Difference Between Data Sync and Backup You Need to Knowfile syncing and backup may seem similar, but they serve very different purposes—and failing to differentiate between them can lead to data loss.
- Instructions for backing up all data on Android device without rootsometimes backing up on your smartphone or tablet is not enough. usually to backup your devices, you can use titanium backup tool or google drive. however, if you want to backup all data on the device, you must use the android software developer kit (sdk). with the android software developer kit (sdk), you can easily back up all data on your android device with a single command.
- How to backup and restore web data with FavBackupif you accidentally reinstall the browser and lose all your data, but why not back up your bookmarks, passwords, or any web browser data? the solution is to install ...
- Instructions for backing up individual messages on iPhoneto retrieve important information, backing up messages on iphone is essential. however, if you back up your messages in the usual way, you will have to go with other types of data such as email, photos, ...
- Things to keep in mind when backing up data on your computerbacking up data on your computer will help users get back important data, when the computer hard drive has trouble using.
- Install Windows Server 2003 and create a backup servernetwork management documentation server 2003 as details of how to install, create a companion server in case the main server is malfunctioning, create a domain, join the client to the domain, the conection {remote desktop from the client data to server}, set adsl router parameters to server, turn off 1 working machine immediately.
- 5 online backup services help secure datain today's modern life, data storage is vital to prevent losing valuable data. still, according to the backblaze poll conducted by harris interactive, of the 2,257 respondents, 1/3 of computers have not been backed up or never backed up.