Rework bin directory

This commit is contained in:
Dave Conroy
2023-11-03 15:02:52 -07:00
parent 3e666ef655
commit 599c3d7940
3 changed files with 25 additions and 5 deletions

View File

@@ -1,4 +0,0 @@
#!/command/with-contenv bash
echo '** Performing Manual Backup'
/etc/services.available/10-db-backup/run manual

View File

@@ -0,0 +1,24 @@
#!/command/with-contenv bash
source /assets/functions/00-container
source /assets/defaults/05-logging
source /assets/defaults/10-db-backup
## Compress each log 2 days old
timestamp_2dayold_unixtime="$(stat -c %Y "${LOG_PATH}"/"$(date --date='2 days ago' +'%Y%m%d')")"
for logfile in "${LOG_PATH}"/"$(date --date='2 days ago' +'%Y%m%d')"/"$(date --date='2 days ago' +'%Y%m%d')"_*.log ; do
sudo -u restic zstd --rm --rsyncable "${logfile}"
done
touch -t $(date -d"@${timestamp_2dayold_unixtime}" +'%Y%m%d%H%m.%S') "${LOG_PATH}"/"$(date --date='2 days ago' +'%Y%m%d')"
# Look fook files older than certain day and delete
if [ -n "${LOG_PATH}" ] && [ -d "${LOG_PATH}" ] ; then
find "${LOG_PATH}" -mtime +"${LOGROTATE_RETAIN_DAYS}" -type d -exec rm -rf {} +
fi
# Look for stale symbolic links and delete accordingly
for symbolic_link in "${LOG_PATH}"/latest*.log ; do
if [ ! -e "${symbolic_link}" ] ; then
rm -rf "${symbolic_link}"
fi
done

View File

@@ -38,7 +38,7 @@ else
"-h" ) "-h" )
cat <<EOF cat <<EOF
${IMAGE_NAME} Restore Tool ${IMAGE_VERSION} ${IMAGE_NAME} Restore Tool ${IMAGE_VERSION}
(c) 2022 Dave Conroy (https://github.com/tiredofit) (c) 2023 Dave Conroy (https://github.com/tiredofit) (https://www.tiredofit.ca)
This script will assist you in recovering databases taken by the Docker image. This script will assist you in recovering databases taken by the Docker image.
You will be presented with a series of menus allowing you to choose: You will be presented with a series of menus allowing you to choose: