Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vim /etc/etckeeper/commit.d/20mirror-outside-files
- #!/bin/sh
- set -e
- # Greg Rundlett info@equality-tech.com
- # based on code from http://serverfault.com/questions/211425
- # If you want other configuration data or files on the system also
- # opportunistically tracked via etckeeper, use this script to copy them in.
- # If there is a hook of some sort available related to the files
- # you're mirroring, (e.g. Apache restart for CSVN)
- # you can call etckeeper directly and track them
- # proactively, rather than just opportunistically here.
- MIRROR_ROOT=/etc/etckeeper.mirror.d
- echo "etckeeper: mirroring outside files to $MIRROR_ROOT/:"
- mirror_dir() {
- LOCAL_PATH=$1
- echo " $LOCAL_PATH"
- mkdir -p $MIRROR_ROOT/$LOCAL_PATH
- rsync -a $LOCAL_PATH/ $MIRROR_ROOT/$LOCAL_PATH
- }
- mirror_file() {
- LOCAL_PATH=$1
- DIRPATH=`dirname $LOCAL_PATH`
- echo " $LOCAL_PATH"
- mkdir -p $MIRROR_ROOT/$DIRPATH
- rsync -a $LOCAL_PATH $MIRROR_ROOT/$DIRPATH
- }
- ###########################################
- ## ADD lines below to invoke the system ###
- ###########################################
- mirror_file "/var/www/html/wiki/LocalSettings.php"
- mirror_dir "/usr/local/csvn/data/conf"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement