Skip to content

Instantly share code, notes, and snippets.

@raybogman raybogman/rsync.sh
Created Jul 24, 2017

Embed
What would you like to do?
#!/bin/bash
#Owner + Group dir
user="cdn01"
# Directory for the backup
dir1="/home/magento/domains/magento-speed.com/public_html/media"
dir2="/home/magento/domains/magento-speed.com/public_html/js"
dir3="/home/magento/domains/magento-speed.com/public_html/skin"
# Destination
dest1="/home/cdn01/domains/jiracdn.nl/public_html/media"
dest2="/home/cdn01/domains/jiracdn.nl/public_html/js"
dest3="/home/cdn01/domains/jiracdn.nl/public_html/skin"
# Technical
rsync_options="-rtuz --delete"
# Copy local backup to remote host
nice -n 19 /usr/bin/rsync $rsync_options $dir1/ $dest1/
nice -n 19 /usr/bin/rsync $rsync_options $dir2/ $dest2/
nice -n 19 /usr/bin/rsync $rsync_options $dir3/ $dest3/
chown -R $user. $dest1 $dest2 $dest3
# End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.