Skip to content

Instantly share code, notes, and snippets.

@raybogman
Created July 24, 2017 11:47
Show Gist options
  • Save raybogman/ceb518e72996d5ff874ebd9ec053111c to your computer and use it in GitHub Desktop.
Save raybogman/ceb518e72996d5ff874ebd9ec053111c to your computer and use it in GitHub Desktop.
#!/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