File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ pushd /mnt/koji/compose/logs || { echo " Could not find the logs" ; exit 1; }
4+
5+ # We'll look for 10 days instead of just 7 days.
6+ SRCS=$( find . -maxdepth 1 -type f -mtime +10)
7+
8+ printf " The following will be deleted\n"
9+ for x in $SRCS ; do echo ${x} ; done
10+
11+ /bin/rm ${SRCS}
12+ popd || { echo " We couldn't leave?" ; exit 1; }
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- pushd /mnt/koji/compose/10/
3+ pushd /mnt/koji/compose/10/ || { echo " Could not change directories " ; exit 1 ; }
44
55SRCS=$( find . -maxdepth 1 -type d -mtime +7 | grep -vE ' SIG-|Rocky-10.[0-9]+-20[2-3][0-9]' | sort)
66
77printf " The following will be deleted\n"
88for x in $SRCS ; do echo ${x} ; done
99
10- rm -rf ${SRCS}
10+ rm -rf ${SRCS} || { echo " Could not switch back " ; exit 1 ; }
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- pushd /mnt/compose/8
3+ pushd /mnt/compose/8 || { echo " Could not change directories " ; exit 1 ; }
44
55SRCS=$( find . -maxdepth 1 -type d -mtime +7 | grep -vE ' SIG-|Rocky-8.10-2024' | sort)
66
77printf " The following will be deleted\n"
88for x in $SRCS ; do echo ${x} ; done
99
10- rm -rf ${SRCS}
10+ rm -rf ${SRCS} || { echo " Could not switch back " ; exit 1 ; }
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- pushd /mnt/koji/compose/9/
3+ pushd /mnt/koji/compose/9/ || { echo " Could not change directories " ; exit 1 ; }
44
55SRCS=$( find . -maxdepth 1 -type d -mtime +7 | grep -vE ' SIG-|Rocky-9.[0-9]+-20[2-3][0-9]' | sort)
66
77printf " The following will be deleted\n"
88for x in $SRCS ; do echo ${x} ; done
99
10- rm -rf ${SRCS}
10+ rm -rf ${SRCS} || { echo " Could not switch back " ; exit 1 ; }
You can’t perform that action at this time.
0 commit comments