aboutsummaryrefslogtreecommitdiff
path: root/send-refresh.sh
diff options
context:
space:
mode:
authorSanJacobs2022-10-09 06:40:21 +0200
committerSanJacobs2022-10-09 06:40:21 +0200
commite5acf314d6109df29952770c26dcd12ba281807a (patch)
tree92c4e75df0a7337ce04a6c4d8618bf84e7f84adb /send-refresh.sh
parenta35ac406fb8b97e15ed133d3401ff57890377cdf (diff)
downloadsend-e5acf314d6109df29952770c26dcd12ba281807a.tar.gz
send-e5acf314d6109df29952770c26dcd12ba281807a.tar.bz2
send-e5acf314d6109df29952770c26dcd12ba281807a.zip
Finishing touches
Diffstat (limited to 'send-refresh.sh')
-rwxr-xr-xsend-refresh.sh17
1 files changed, 1 insertions, 16 deletions
diff --git a/send-refresh.sh b/send-refresh.sh
index 422f787..3df4a51 100755
--- a/send-refresh.sh
+++ b/send-refresh.sh
@@ -1,17 +1,5 @@
#!/bin/bash
-# Recursively delete directories by age (14 days), and only exactly at the depth of the base directory
-#find /path/to/base/dir/ -mindepth 1 -maxdepth 1 -type d -ctime +14 -exec rm -rf {} \;
-
-
-# Discover files in the user's home directory, older than 14 days, and delete them
-#find /path/to/home/dir/ -mindepth 1 -maxdepth 1 -type f -ctime +14 -exec rm -rf {} \;
-# Discover files in the user's home directory, younger than 14 days
-#find /path/to/home/dir/ -mindepth 1 -maxdepth 1 -type f -ctime -14
-
-# command for getting the filename out of a full path
-#basename /path/to/file.zip
-
# Creating an arrays of home directory files:
webdir="testdir/website/"
@@ -26,9 +14,6 @@ old_files=()
while IFS= read -r -d $'\0'; do
old_files+=("$REPLY")
done < <(find $webdir* -mindepth 1 -maxdepth 1 -type f -ctime +14 -name "*.zip" -print0)
-# +14 this should say
-
-# Looping over said array:
echo " --- Young files ---"
for file in "${young_files[@]}"; do
@@ -60,7 +45,7 @@ for file in "${young_files[@]}"; do
done
-echo " --- Old files ---"
+echo "\n --- Old files ---"
for file in "${old_files[@]}"; do
filename=$(basename "$file")
checksum=$(md5sum "$file" | awk '{print $1;}')