aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-04-03 13:33:43 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-04-03 13:33:43 -0300
commitc3bb7c52671a4725721bff628f982b228806fc90 (patch)
tree4aea9a00b465e77e74bbcc16ad4f5a341a86865c
parent5d2fb4e393aef6f8046e3c29ca85a36159059cfc (diff)
downloadscripts-c3bb7c52671a4725721bff628f982b228806fc90.tar.gz
scripts-c3bb7c52671a4725721bff628f982b228806fc90.tar.bz2
Video support at dangling-archive
-rwxr-xr-xdangling-archive9
1 files changed, 9 insertions, 0 deletions
diff --git a/dangling-archive b/dangling-archive
index fbe20de..09c0027 100755
--- a/dangling-archive
+++ b/dangling-archive
@@ -12,6 +12,8 @@ DOC="$HOME/data/doc/incoming"
DOC_PATTERN=".*\.(txt|doc|docx|rtf|pdf|sxc|csv|odt|odf|ods|ppt|epub|mobi|djvu|lit)"
NOISE="$HOME/data/noise/incoming"
NOISE_PATTERN=".*\.(mp3|ogg|opus|m4a)"
+VIDEO="$HOME/data/video/incoming"
+VIDEO_PATTERN=".*\.(mp4|mov|mkv|avi|srt|mpg)"
FIND_OPTS="-maxdepth 1 -regextype posix-egrep -iregex"
# Ensure all folders exist
@@ -37,3 +39,10 @@ if [ "`find $LOAD/ $FIND_OPTS "$NOISE_PATTERN" | wc -l`" != "0" ]; then
mkdir -p $NOISE/$DATE
find $LOAD/ $FIND_OPTS "$NOISE_PATTERN" -exec mv {} $NOISE/$DATE/ \;
fi
+
+# Move video
+if [ "`find $LOAD/ $FIND_OPTS "$VIDEO_PATTERN" | wc -l`" != "0" ]; then
+ echo "Moving video into $VIDEO/$DATE ..."
+ mkdir -p $VIDEO/$DATE
+ find $LOAD/ $FIND_OPTS "$VIDEO_PATTERN" -exec mv {} $VIDEO/$DATE/ \;
+fi