/go/fsync copies a folder, with everything in it, to another server. It is useful when you move a site or its data between servers. It connects to the remote server as root with a password, creates the same folder there if it doesn't exist, and copies the contents with rsync. Only new and changed files are sent, so you can run it again to bring the copy up to date. It can pick up after an interrupted transfer. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
/go/fsync /home/example.com/www 203.0.113.5 'RemoteRootPassword'
Options
| Argument | Required | Default | Notes |
|---|---|---|---|
<directory> |
Yes | — | The folder on this server. A trailing / is added if it is missing. Use a path without spaces. |
<remote-server> |
Yes | — | The IP address or host name of the remote server. |
<remote-password> |
Yes | — | The remote server’s root password. |
[port] |
No | 22 |
The SSH port of the remote server. |
The remote server must:
- allow
rootto log in over SSH with a password (seepermitrootlogin) - have
rsyncinstalled
This server needs sshpass and rsync installed.
Examples
# Copy a site's files to another server
/go/fsync /home/example.com/www 203.0.113.5 'RemoteRootPassword'
# The remote SSH server listens on port 2222
/go/fsync /home/example.com/www 203.0.113.5 'RemoteRootPassword' 2222
# Run it again later to send only what changed
/go/fsync /home/example.com/www 203.0.113.5 'RemoteRootPassword'
Output
Copying /home/example.com/www to 203.0.113.5...
sending incremental file list
index.php
4.20K 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=10/12)
...
The command prints the progress of rsync for each file. It doesn’t print a message when it finishes. The exit status is the one returned by rsync (0 means success).
| Outcome | What you get |
|---|---|
| Folder doesn’t exist | An error line ending in command not found (see Troubleshooting), then exit status 1. |
| Copy finished | The last rsync lines. Exit status 0. |
Every run is logged to /var/log/go/fsync.log with a timestamp and the arguments used. The log includes the password you typed.
See the full reference at /go/fsync and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
