diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-08-20 20:44:34 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-08-20 20:44:34 -0300 |
commit | e851401694daacaf1aba2c87ed557e5dbf00af02 (patch) | |
tree | d772b15f3a5ba9e015936f7162f448a7208a4001 /dangling-archive | |
parent | d6a4d78d31ffa57e00a7d5b0a87baa38156cee06 (diff) | |
download | scripts-e851401694daacaf1aba2c87ed557e5dbf00af02.tar.gz scripts-e851401694daacaf1aba2c87ed557e5dbf00af02.tar.bz2 |
Move scripts to other repositories
Diffstat (limited to 'dangling-archive')
-rwxr-xr-x | dangling-archive | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/dangling-archive b/dangling-archive deleted file mode 100755 index e9a66c2..0000000 --- a/dangling-archive +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# -# Archive dangling files. -# - -# Parameters -DATE="`date +%Y%m%d%I%M%S`" -LOAD="$HOME/load" -IMAGES="$HOME/data/images/incoming" -IMAGES_PATTERN=".*\.(png|jpg|jpeg|gif|svg)" -DOC="$HOME/data/doc/incoming" -DOC_PATTERN=".*\.(txt|doc|docx|rtf|pdf|sxc|csv|odt|odf|ods|xls|xlsx|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 -mkdir -p $LOAD $IMAGES $DOC - -# Move images -if [ "`find $LOAD/ $FIND_OPTS "$IMAGES_PATTERN" | wc -l`" != "0" ]; then - echo "Moving images into $IMAGES/$DATE ..." - mkdir -p $IMAGES/$DATE - find $LOAD/ $FIND_OPTS "$IMAGES_PATTERN" -exec mv {} $IMAGES/$DATE/ \; -fi - -# Move doc -if [ "`find $LOAD/ $FIND_OPTS "$DOC_PATTERN" | wc -l`" != "0" ]; then - echo "Moving docs into $DOC/$DATE ..." - mkdir -p $DOC/$DATE - find $LOAD/ $FIND_OPTS "$DOC_PATTERN" -exec mv {} $DOC/$DATE/ \; -fi - -# Move noise -if [ "`find $LOAD/ $FIND_OPTS "$NOISE_PATTERN" | wc -l`" != "0" ]; then - echo "Moving noise into $NOISE/$DATE ..." - 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 |