Automate multi-server FTP/SFTP file uploads and text file editing for Source dedicated servers
- Add files to upload folder according to folder structure seen after login, e.g.
/tf
. New folders will automatically be created. - Fill
ftp_logins
with ftp/sftp login and rcon information for the servers. See the file for examples of the required fields. - Edit
ftp_upload_run
to define list of servers to upload to, along with optional rcon commands (Sourcemod plugins will automatically be loaded/reloaded) - Set
force_reupload
toTrue
to ignore file size check and upload anyway. (Useful when the file size has not changed since we can only compare files by size in FTP) - Include the full path to the file for
delete
list of file deletions, e.g./tf/addons/sourcemod/plugins/myplugin.smx
- Plugin deletions are not automatically unloaded. You will have to set
rcon
with a command likesm plugins unload myplugin
. - Execute
python ftp_upload_run
- Fill
ftp_logins
with ftp/sftp login and rcon information for the servers. See the file for examples of the required fields. - Edit
ftp_edit_run
to define list of servers to connect to, along with optional rcon commands - Add to
edits
the list of sequential operations to run on each server. - Operations can be chained in the event of failure. (See the Replace with Insert failover example.)
- Set
read_only
toTrue
for a dry run without uploading changes. - Set
backup
toTrue
to enable backup of files prior to uploading changes (or a Backup operation). These are sorted per server folder inbackups/<date>-<time>/<server>
. - Set
max_backups
to the number of backups to keep. Each run that writes at least one backup file counts as one backup.
Command
- Send one or more rcon commands to the serverBackup
- Create a backup of the specifiedfile
.backup
variable at the bottom must be set toTrue
Print
- Dump the contents of the text file to console.Sort
- Sorts the lines in the text file alphabetically (without blank lines).Find
- Search the text file with regexsearch
FindDuplicates
- Search the text file with regexsearch
and remove subsequent lines with duplicate matches.Insert
- Insert a line into the text file relative to regexafter
,before
, or at the end of the file if neither are specified.Replace
- Replace a line in the text file matching regexsearch
withreplace
(regex capture groups permitted)Delete
- Delete a line in the text file matching regexsearch
- All edit operations support
failover
of another Edit Operation andrcon
for rcon commands (string or list of strings)
- Run
clear_uploads.sh
to clear the files in the upload folder while preserving the empty folders for future use.