Platonides has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76313
Change subject: Simple tool to simplify using the backup snapshots
......................................................................
Simple tool to simplify using the backup snapshots
Change-Id: I0740049c273a37e7117ec862a29665ab5b8e4b18
---
A misctools/backups
1 file changed, 31 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs
refs/changes/13/76313/1
diff --git a/misctools/backups b/misctools/backups
new file mode 100755
index 0000000..9555812
--- /dev/null
+++ b/misctools/backups
@@ -0,0 +1,31 @@
+#!/bin/bash
+set -eu
+shopt -s extglob
+
+if [ ! -f .snaplist ]; then
+ echo "There's no .snaplist file on $PWD"
+ echo Are you sure it is being backed up? You may need to run this command in
/home or /data/project
+ exit
+fi
+
+echo The following snapshots are available for $PWD:
+nl .snaplist
+
+echo ""
+echo "Select an snapshot to mount or press exit to quit"
+read selection
+
+case $selection in
+ exit|quit)
+ exit;;
+ +([0-9])) # Using extglob
+ snapshot=$(sed -n "${selection}p" .snaplist)
+ echo -n "Mounting snapshot at $PWD/.snapshot/$snapshot"...
+ cd "$PWD/.snapshot/$snapshot" && echo " Done"
+ echo "Opening a shell for you in $PWD. You can write 'exit' in order to
return to $OLDPWD"
+ exec bash;;
+ *)
+ echo " Wrong option «$selection»"
+ exit 1;;
+esac
+
--
To view, visit https://gerrit.wikimedia.org/r/76313
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0740049c273a37e7117ec862a29665ab5b8e4b18
Gerrit-PatchSet: 1
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: Platonides <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits