generated from me/template-mit
Split SYNC folders out to have their own commands -- for safety! :)
This commit is contained in:
60
rc_shared.sh
60
rc_shared.sh
@@ -78,6 +78,18 @@ function pull-clone { pull_clone.sh; }
|
|||||||
alias get-clone="pull-clone"
|
alias get-clone="pull-clone"
|
||||||
alias sync-clone="pull-clone"
|
alias sync-clone="pull-clone"
|
||||||
|
|
||||||
|
alias send-sync="send-master"
|
||||||
|
alias push-sync="send-master"
|
||||||
|
alias pull-sync="pull-clone"
|
||||||
|
alias get-sync="pull-clone"
|
||||||
|
function sync-sync {
|
||||||
|
cat <<- EOF
|
||||||
|
Command not implemented, too dangerous guessing the state of the folder.
|
||||||
|
|
||||||
|
Please use push-sync and pull-sync in the correct order for its current state.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
function goodbye { update -y; bye; }
|
function goodbye { update -y; bye; }
|
||||||
|
|
||||||
function clone {
|
function clone {
|
||||||
@@ -89,34 +101,70 @@ function today { date "+%Y%m%d"; }
|
|||||||
|
|
||||||
# Enhance Bin Scripts #
|
# Enhance Bin Scripts #
|
||||||
|
|
||||||
|
# MASTER and CLONE folders.
|
||||||
|
|
||||||
function send-masters {
|
function send-masters {
|
||||||
echo -e "`date` - Looping through MASTER & SYNC directories."
|
echo -e "`date` - Looping through MASTER directories."
|
||||||
ls | grep "\-MASTER\|\-SYNC" | while read dir; do
|
ls | grep "\-MASTER" | while read dir; do
|
||||||
echo -e "\n`date` - Found '$dir'..."
|
echo -e "\n`date` - Found '$dir'..."
|
||||||
cd $dir
|
cd $dir
|
||||||
send-master
|
send-master
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
echo -e "\n`date` - Done checking for MASTER & SYNC directories."
|
echo -e "\n`date` - Done checking for MASTER directories."
|
||||||
}
|
}
|
||||||
alias push-masters="send-masters"
|
alias push-masters="send-masters"
|
||||||
alias sync-masters="send-masters"
|
alias sync-masters="send-masters"
|
||||||
|
|
||||||
function pull-clones {
|
function pull-clones {
|
||||||
echo -e "`date` - Looping through clone & SYNC directories."
|
echo -e "`date` - Looping through clone directories."
|
||||||
ls | grep "\-clone\|\-SYNC" | while read dir; do
|
ls | grep "\-clone" | while read dir; do
|
||||||
echo -e "\n`date` - Found '$dir'..."
|
echo -e "\n`date` - Found '$dir'..."
|
||||||
cd $dir
|
cd $dir
|
||||||
pull-clone
|
pull-clone
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
echo -e "\n`date` - Done checking for clone & SYNC directories."
|
echo -e "\n`date` - Done checking for clone directories."
|
||||||
}
|
}
|
||||||
alias get-clones="pull-clones"
|
alias get-clones="pull-clones"
|
||||||
alias sync-clones="pull-clones"
|
alias sync-clones="pull-clones"
|
||||||
|
|
||||||
function sync-all { push-masters; pull-clones; }
|
function sync-all { push-masters; pull-clones; }
|
||||||
|
|
||||||
|
# SYNC folders.
|
||||||
|
|
||||||
|
function send-syncs {
|
||||||
|
echo -e "`date` - Looping through SYNC directories."
|
||||||
|
ls | grep "\-SYNC" | while read dir; do
|
||||||
|
echo -e "\n`date` - Found '$dir'..."
|
||||||
|
cd $dir
|
||||||
|
send-master
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
echo -e "\n`date` - Done checking for SYNC directories."
|
||||||
|
}
|
||||||
|
alias push-syncs="send-syncs"
|
||||||
|
|
||||||
|
function pull-syncs {
|
||||||
|
echo -e "`date` - Looping through SYNC directories."
|
||||||
|
ls | grep "\-SYNC" | while read dir; do
|
||||||
|
echo -e "\n`date` - Found '$dir'..."
|
||||||
|
cd $dir
|
||||||
|
pull-clone
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
echo -e "\n`date` - Done checking for SYNC directories."
|
||||||
|
}
|
||||||
|
alias get-syncs="pull-syncs"
|
||||||
|
|
||||||
|
function sync-syncs {
|
||||||
|
cat <<- EOF
|
||||||
|
Command not implemented, too dangerous guessing the state of the folder.
|
||||||
|
|
||||||
|
Please use push-syncs and pull-syncs in the correct order for its current state.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Audio #
|
# Audio #
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user