Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rsync via hard link whole tree of blobs (Plone/Zope)
echo "COPY DB ----------------------------------------------------------------------"
rm -rf latest-pgdb
cp -R live-pgdb latest-pgdb
chown -R 500.1001 latest-pgdb
echo "COPY BLOBS -------------------------------------------------------------------"
SOURCE=/data/aaf/live-blobs
TARGET=/data/aaf/latest-blobs
LINKDEST=`python3 -c "import os.path; print(os.path.relpath('$SOURCE', '$TARGET'))"`
rsync -avh --delete-during --link-dest=$LINKDEST $SOURCE/ $TARGET
echo "COPY NGINX -------------------------------------------------------------------"
SOURCE=/data/aaf/live-nginx-at
TARGET=/data/aaf/latest-nginx-at
LINKDEST=`python3 -c "import os.path; print(os.path.relpath('$SOURCE', '$TARGET'))"`
rsync -avh --delete-during --link-dest=$LINKDEST $SOURCE/ $TARGET
SOURCE=/data/aaf/live-static
echo "COPY STATIC ------------------------------------------------------------------"
TARGET=/data/aaf/latest-static
LINKDEST=`python3 -c "import os.path; print(os.path.relpath('$SOURCE', '$TARGET'))"`
rsync -avh --delete-during --link-dest=$LINKDEST $SOURCE/ $TARGET
echo "DONE ------ ------------------------------------------------------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment