Created
May 13, 2019 12:51
-
-
Save czj/c7c6b39eaca531a2554d0962d1f58515 to your computer and use it in GitHub Desktop.
Download a Rails application's production attachements to your local machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
APP_HOME=$( cd ${0%/*} && pwd -P )"/.." | |
REMOTE_SHARED="railsapp@host.domain.net:~/www/railsapp/shared" | |
SPEED_LIMIT="" | |
# Un-comment this line if you want to limit the download speed to un-clog your connexion | |
# SPEED_LIMIT="--bwlimit=500" | |
# -l forces copy of symlinks | |
# | |
# Other filters in exclude_assets to avoid getting large images | |
# **.[pP][dD][fF] | |
# **original** | |
# Make sure you are using a recent rsync version (3+) for the progress2 info | |
ARGS="--delete -lPrt --safe-links --exclude-from=$APP_HOME/script/exclude_assets --human-readable --progress --info=progress2 $SPEED_LIMIT" | |
rsync $ARGS $REMOTE_SHARED/public/attachments/ $APP_HOME/public/attachments/ | |
rsync $ARGS $REMOTE_SHARED/private/ $APP_HOME/private/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**.gz | |
_cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment