Skip to content

Instantly share code, notes, and snippets.

@fasthold
Created October 25, 2013 03:16
Show Gist options
  • Save fasthold/7148964 to your computer and use it in GitHub Desktop.
Save fasthold/7148964 to your computer and use it in GitHub Desktop.
使用 ScriptFTP 进行远程备份同步。这是 ScriptFTP所用的脚本
# The host, user name and password are stored in variables.
# Change the text between the quotes with your own settings.
$hostname="192.168.1.x"
$user="username"
$password="password"
# Variables are also used to store the local and remote path
# of the website.
$localwebfolder="D:\path\to\backup\folder"
$remotewebfolder="/remote/sub/foler"
# Connect to the FTP server. Variables are used as OPENHOST parameters.
OPENHOST($hostname,$user,$password)
MKDIR($remotewebfolder)
# Upload the new or modified files. Subdirectories are ignored.
SYNC($localwebfolder,$remotewebfolder,UPLOAD,SUBDIRS)
# Close the connection
CLOSEHOST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment