aboutsummaryrefslogtreecommitdiffstats
path: root/jsaccess
diff options
context:
space:
mode:
Diffstat (limited to 'jsaccess')
-rwxr-xr-xjsaccess/jstore.sh23
1 files changed, 19 insertions, 4 deletions
diff --git a/jsaccess/jstore.sh b/jsaccess/jstore.sh
index b0177b2..4bb40df 100755
--- a/jsaccess/jstore.sh
+++ b/jsaccess/jstore.sh
@@ -37,6 +37,7 @@ usage_exit() {
echo " push [store]"
echo " rset <rsync_uri> [store]"
echo " rget [store]"
+ echo " clone <rsync_uri> <store>"
echo
echo "actions to get informations:"
echo " help|-h"
@@ -221,6 +222,14 @@ action_wipe() {
echo "DELETED store \"$store\""
}
+action_push() {
+ _rget
+ rm -f $tmp
+ cmd="rsync -rvzP --delete $store/ $rsync_uri"
+ echo "Running \"$cmd\""
+ $cmd
+}
+
action_rset() {
_rset $1
}
@@ -230,12 +239,14 @@ action_rget() {
echo "rsync_uri: $rsync_uri"
}
-action_push() {
- _rget
- rm -f $tmp
- cmd="rsync -rvzP --delete $store/ $rsync_uri"
+action_clone() {
+ rsync_uri=$1
+ store=$2
+ [ -e $store ] && echo "ERROR: $store already exists" && clean_exit 1
+ cmd="rsync -rvzP --delete $rsync_uri $store"
echo "Running \"$cmd\""
$cmd
+ echo "CREATED store \"store\""
}
# Check for dependencies
@@ -298,6 +309,10 @@ rget)
_store_get $2
action_rget
;;
+clone)
+ [ $# -ne 3 ] && usage_exit
+ action_clone $2 $3
+ ;;
help|-h|version|-V)
usage_exit
;;