Update for 6.8
This commit is contained in:
parent
a8530f4a10
commit
fdc08739f1
1 changed files with 36 additions and 7 deletions
43
iscsi_fix.sh
43
iscsi_fix.sh
|
@ -2,16 +2,45 @@
|
||||||
# iscsi share fix
|
# iscsi share fix
|
||||||
# use this script to rebuild default configs for shares if the ._share becomes
|
# use this script to rebuild default configs for shares if the ._share becomes
|
||||||
# broken for whatever reason.
|
# broken for whatever reason.
|
||||||
|
echo "Activating iSCSI share rebuilder"
|
||||||
(
|
echo "Querying readynasd for list of volumes..."
|
||||||
x=$(rn_nml -g volumes | grep "resource-id" | sed 's/^.*id="//;s/".*//;')
|
x=$(rn_nml -g volumes | grep "resource-id" | sed 's/^.*id="//;s/".*//;')
|
||||||
for volume in "$x"
|
number=$(echo $x | wc -w)
|
||||||
|
echo "$number volume(s) found."
|
||||||
|
for volume in ${x}
|
||||||
do
|
do
|
||||||
|
echo -n "Investigating volume /$volume..."
|
||||||
for i in `find /"$volume" -maxdepth 2 -type d -name ".iscsi" | sed "s/\/.iscsi//g;s/\/$volume\///g;"`
|
for i in `find /"$volume" -maxdepth 2 -type d -name ".iscsi" | sed "s/\/.iscsi//g;s/\/$volume\///g;"`
|
||||||
do
|
do
|
||||||
mkdir -p /"$volume"/._share/${i} cd /"$volume"/._share/${i}
|
path="/$volume/._share/${i}"
|
||||||
echo "comment " > iscsi.conf
|
echo "Found /$volume/${i}... recreating configs...".
|
||||||
echo "0 0 0 * 0 0 0" > snapshot.conf
|
mkdir -p $path
|
||||||
|
cat > $path/iscsi.conf << EOF
|
||||||
|
comment
|
||||||
|
alert_threshold 80
|
||||||
|
EOF
|
||||||
|
cat > $path/custom_snapshot_management.conf << EOF
|
||||||
|
enabled = no
|
||||||
|
retention_rule = lifetime
|
||||||
|
lifetime = 2592000
|
||||||
|
number = 30
|
||||||
|
nonempty_snapshots = yes
|
||||||
|
prev_versions = no
|
||||||
|
EOF
|
||||||
|
cat > $path/custom_snapshot_schedule.conf << EOF
|
||||||
|
........................
|
||||||
|
........................
|
||||||
|
........................
|
||||||
|
........................
|
||||||
|
........................
|
||||||
|
........................
|
||||||
|
........................
|
||||||
|
EOF
|
||||||
|
cat > $path/snapshot.conf << EOF
|
||||||
|
0 0 0 * 0 0 0
|
||||||
|
EOF
|
||||||
|
echo " Done with /$volume/${i}."
|
||||||
done
|
done
|
||||||
|
echo " Done with /$volume"
|
||||||
done
|
done
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue