summaryrefslogtreecommitdiff
path: root/archive_an_image.sh
diff options
context:
space:
mode:
authorPatrick Darley <patrick.darley@codethink.co.uk>2015-09-14 13:02:40 +0000
committerPatrick Darley <patrick.darley@codethink.co.uk>2015-09-14 13:05:59 +0000
commit68f789efb66b2bf2717d97241701e7051b9e0fea (patch)
treecf57f2329b48f0a15825f47948c0a11cf60f10a8 /archive_an_image.sh
parentd2cca8ebd658039cea7e1d2d72471dde6c8277e8 (diff)
downloadbuildslave-scripts-68f789efb66b2bf2717d97241701e7051b9e0fea.tar.gz
a script to archive generated images
Diffstat (limited to 'archive_an_image.sh')
-rw-r--r--archive_an_image.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/archive_an_image.sh b/archive_an_image.sh
new file mode 100644
index 0000000..aec6c60
--- /dev/null
+++ b/archive_an_image.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Script to archive an image generated by the ciat pipeline
+
+img_path="$1"
+archive_dir=/archive/images
+
+# Create am archive directory based on the img date
+img_date=`date -r "$img_path" +"%y-%m-%d_%H%M"`
+archive_path="$archive_dir$img_date"
+mkdir -p "$archive_path"
+
+# Move the img to the archive
+mv "$img_path" "$archive_path"