summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
Diffstat (limited to 'extras')
-rw-r--r--extras/Makefile.am2
-rwxr-xr-xextras/post-upgrade-script-for-quota.sh6
-rwxr-xr-xextras/pre-upgrade-script-for-quota.sh7
3 files changed, 11 insertions, 4 deletions
diff --git a/extras/Makefile.am b/extras/Makefile.am
index 3d780a0058f..c2c1c419769 100644
--- a/extras/Makefile.am
+++ b/extras/Makefile.am
@@ -9,6 +9,8 @@ conf_DATA = glusterfs-logrotate gluster-rsyslog-7.2.conf gluster-rsyslog-5.8.con
voldir = $(sysconfdir)/glusterfs
vol_DATA = glusterd.vol
+scriptsdir = $(datadir)/glusterfs/scripts
+scripts_DATA = post-upgrade-script-for-quota.sh pre-upgrade-script-for-quota.sh
EXTRA_DIST = specgen.scm MacOSX/Portfile glusterfs-mode.el glusterfs.vim \
migrate-unify-to-distribute.sh backend-xattr-sanitize.sh \
diff --git a/extras/post-upgrade-script-for-quota.sh b/extras/post-upgrade-script-for-quota.sh
index 3347031cdab..13b65e8870e 100755
--- a/extras/post-upgrade-script-for-quota.sh
+++ b/extras/post-upgrade-script-for-quota.sh
@@ -10,6 +10,8 @@
VOL=$1;
+BACKUP_DIR=/var/tmp/glusterfs/quota-config-backup
+
function set_limits {
local var=$(gluster volume info $1 | grep 'features.quota'| cut -d" " -f2);
@@ -31,8 +33,8 @@ function set_limits {
gluster volume start $1 force
sleep 3;
- local path_array=( $(cat /tmp/quota-config-backup/vol_$1 | tail -n +3 | awk '{print $1}') )
- local limit_array=( $(cat /tmp/quota-config-backup/vol_$1 | tail -n +3 | awk '{print $2}') )
+ local path_array=( $(cat $BACKUP_DIR/vol_$1 | tail -n +3 | awk '{print $1}') )
+ local limit_array=( $(cat $BACKUP_DIR/vol_$1 | tail -n +3 | awk '{print $2}') )
local len=${#path_array[@]}
for ((j=0; j<$len; j++))
diff --git a/extras/pre-upgrade-script-for-quota.sh b/extras/pre-upgrade-script-for-quota.sh
index 522e41206d0..ddb4f7fa450 100755
--- a/extras/pre-upgrade-script-for-quota.sh
+++ b/extras/pre-upgrade-script-for-quota.sh
@@ -5,12 +5,15 @@
#This script must be run prior to upgrading the cluster to 3.5, that too on
#only one of the nodes in the cluster.
-mkdir -p /tmp/quota-config-backup
+BACKUP_DIR=/var/tmp/glusterfs/quota-config-backup
+
+mkdir -p $BACKUP_DIR
+
for i in `gluster volume list`; do
var=$(gluster volume info $i | grep 'features.quota'| cut -d" " -f2);
if [ -z "$var" ] || [ "$var" == "off" ]; then
continue
else
- gluster volume quota $i list > /tmp/quota-config-backup/vol_$i;
+ gluster volume quota $i list > $BACKUP_DIR/vol_$i;
fi;
done