# Server administration

# Public Key

Copy your public key on Mac OS: cat ~/.ssh/id_rsa.pub | pbcopy

# Creating Backups

Backup assets for a site using tar: tar -zcvf archive.tar.gz wp-content/uploads/

Expand the backup: tar -zxvf archive.tar.gz

# Useful transfer methods

Rsync

Download files from a remote using Rsync (fast!). You can also replace servername with the IP address:

rsync -avHe ssh <serveruser>@<servername>:/path/to/remote/directory/backup.gz /path/to/local/directory/.

Upload to a remote using Rsync:

rsync -avH <filename.txt> -e ssh <serveruser>@<servername>:/path/to/remote/directory/.

Learn more about Rsync methods here (opens new window)

Curl

Download from a server using Curl: curl -o filename http://somewebsite.com/examplefile.zip

# General / Uptime

Check the IP address using the domain: ping www.dusted.com

Check the repsonse code for a website: curl -IL https://www.dusted.com