aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/deploy6
-rwxr-xr-xshare/hydractl/provision6
-rwxr-xr-xshare/hydractl/sync-backups13
-rwxr-xr-xshare/hydractl/sync-home2
-rwxr-xr-xshare/hydractl/sync-media10
-rwxr-xr-xshare/hydractl/sync-tpc2
6 files changed, 26 insertions, 13 deletions
diff --git a/share/hydra/deploy b/share/hydra/deploy
index b675577..5fabb6c 100755
--- a/share/hydra/deploy
+++ b/share/hydra/deploy
@@ -151,6 +151,9 @@ for node in $NODES; do
# Fix ssl folder ownership
$SUDO chown -R `whoami`: $HYDRA_FOLDER/puppet/ssl
+ # Fix devices folder ownership
+ $SUDO chown -R `whoami`: $HYDRA_FOLDER/puppet/devices
+
# Import keys if needed
if ! $SUDO test -f /root/.ssh/id_rsa || \
! $SUDO test -f /root/.config/borg/hydra/key || \
@@ -300,7 +303,8 @@ if [ -e "$HYDRA_FOLDER/ansible/ansible.cfg" ]; then
if [ "$NODES" == "all" ]; then
hydra $HYDRA ansible-playbook site.yml $ANSIBLE_ARGS
else
- hydra $HYDRA ansible-playbook site.yml $ANSIBLE_ARGS --limit $NODES
+ NODES="`echo $NODES | tr ' ' ','`"
+ hydra $HYDRA ansible-playbook site.yml $ANSIBLE_ARGS --limit "$NODES"
fi
fi
fi
diff --git a/share/hydractl/provision b/share/hydractl/provision
index 352e783..7d224e3 100755
--- a/share/hydractl/provision
+++ b/share/hydractl/provision
@@ -118,16 +118,16 @@ function hydra_provision_config {
hydra_user_config interactive y "Interactive mode? (y/n)"
hydra_user_config device /dev/sdb "Physical device(s) (more than one auto sets RAID mode)"
hydra_user_config swap_size 2000 "Swap size (in MB, 0 to not create it)"
- hydra_user_config root_size 20G "Size of root partition (-1 for all free space)"
+ hydra_user_config root_size 40G "Size of root partition (-1 for all free space)"
if [ "$root_size" != "-1" ]; then
- hydra_user_config home_size 20G "Size of home partition (0 to not create it, -1 for all free space)"
+ hydra_user_config home_size 40G "Size of home partition (0 to not create it, -1 for all free space)"
else
home_size="0"
fi
if [ "$root_size" != "-1" ] && [ "$home_size" != "-1" ]; then
- hydra_user_config var_size 20G "Size of var partition (0 to not create it, -1 for all free space)"
+ hydra_user_config var_size 40G "Size of var partition (0 to not create it, -1 for all free space)"
else
var_size="0"
fi
diff --git a/share/hydractl/sync-backups b/share/hydractl/sync-backups
index 844d630..9cc79de 100755
--- a/share/hydractl/sync-backups
+++ b/share/hydractl/sync-backups
@@ -7,12 +7,21 @@
BASENAME="`basename $0`"
VOLUME="$1"
MEDIA="/media/$VOLUME"
-BWLIMIT=${BWLIMIT:=32000}
+BWLIMIT=${BWLIMIT:=0}
IMAGES="/var/data/crypt/"
-RSYNC="ionice -c 3 nice -n 19 rsync -avH --delete --bwlimit=$BWLIMIT"
CP="ionice -c 3 nice -n 19 cp"
WHOAMI="`whoami`"
+# Set bandwidth limit
+if [ "$BWLIMIT" != "0" ]; then
+ BWLIMIT="--bwlimit=$BWLIMIT"
+else
+ BWLIMIT=""
+fi
+
+# Build rsync command line
+RSYNC="ionice -c 3 nice -n 19 rsync -avH --delete $BWLIMIT"
+
# Sync backups for a node.
function sync_backups_node {
if [ ! -z "$NODE" ]; then
diff --git a/share/hydractl/sync-home b/share/hydractl/sync-home
index a0460e9..b2cd85f 100755
--- a/share/hydractl/sync-home
+++ b/share/hydractl/sync-home
@@ -4,7 +4,7 @@
#
# Parameters
-BASENAME="$0"
+BASENAME="`basename $0`"
TPC="$1"
DEST="/media/$1"
MEDIA="$DEST/var/cache/$TPC/media"
diff --git a/share/hydractl/sync-media b/share/hydractl/sync-media
index 742123e..8132315 100755
--- a/share/hydractl/sync-media
+++ b/share/hydractl/sync-media
@@ -67,8 +67,8 @@ function sync_media_add_metadata {
find -name metadata.pdf.lua.old -exec git add {} \;
# Darktable sidecar files
- find -name '*.xmp' -type l ! -path '*.git' -exec git annex unlock {} \;
- find -name '*.xmp' ! -path '*.git' -exec git add {} \;
+ find -name '*.xmp' -type l -not -path '*.git*' -exec git annex unlock {} \;
+ find -name '*.xmp' -not -path '*.git*' -exec git add {} \;
}
# If there is a playlists folder, make sure mpd user can write to it
@@ -136,7 +136,7 @@ function sync_media_ensure_remote {
local remote="$1"
local path="$2"
- if [ -z "$remote" ] || [ "$remote" == "local" ] || [ -z "$path" ]; then
+ if [ -z "$remote" ] || [ "$remote" == "local" ] || [ "$remote" == "localhost" ] || [ -z "$path" ]; then
return
fi
@@ -172,7 +172,7 @@ fi
# Set drive config
# Ingore drive/volume if it's set to "local"
-if [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ]; then
+if [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ] && [ "$REMOTE" != "localhost" ]; then
# Check storage media
MOUNT="`mount | grep $VOLUME`"
if [ ! -z "$MOUNT" ]; then
@@ -382,7 +382,7 @@ if [ ! -z "$DRIVE" ] && [ -d "$VOLUME/$MEDIA" ]; then
fi
fi
done
-elif [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ]; then
+elif [ ! -z "$REMOTE" ] && [ "$REMOTE" != "local" ] && [ "$REMOTE" != "localhost" ]; then
# Try to copy to a remote
for folder in `ls $CACHE`; do
if [ -d "$CACHE/$folder/.git/annex" ]; then
diff --git a/share/hydractl/sync-tpc b/share/hydractl/sync-tpc
index c739c5a..0a72866 100755
--- a/share/hydractl/sync-tpc
+++ b/share/hydractl/sync-tpc
@@ -4,7 +4,7 @@
#
# Parameters
-BASENAME="$0"
+BASENAME="`basename $0`"
TPC="$1"
DEST="/media/$1"
MEDIA="$DEST/var/cache/$TPC/media"