mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-28 22:20:35 +01:00
added forgotten variables, corrected some variables
This commit is contained in:
parent
ff2006437f
commit
fc58962f79
1 changed files with 7 additions and 3 deletions
10
dockcheck.sh
10
dockcheck.sh
|
|
@ -99,6 +99,10 @@ c_blue="\033[0;34m"
|
||||||
c_teal="\033[0;36m"
|
c_teal="\033[0;36m"
|
||||||
c_reset="\033[0m"
|
c_reset="\033[0m"
|
||||||
|
|
||||||
|
# Timestamps
|
||||||
|
RunTimestamp=$(date +'%Y-%m-%d_%H%M')
|
||||||
|
RunEpoch=$(date +'%s')
|
||||||
|
|
||||||
while getopts "ayfFhiIlmMnprsuvc:e:d:k:t:x:R" options; do
|
while getopts "ayfFhiIlmMnprsuvc:e:d:k:t:x:R" options; do
|
||||||
case "${options}" in
|
case "${options}" in
|
||||||
a|y) AutoMode=true ;;
|
a|y) AutoMode=true ;;
|
||||||
|
|
@ -565,7 +569,7 @@ if [[ -n "${GotUpdates:-}" ]]; then
|
||||||
ContRepo=${ContFull%:*}
|
ContRepo=${ContFull%:*}
|
||||||
ContApp=${ContRepo#*/}
|
ContApp=${ContRepo#*/}
|
||||||
ContTag=${ContFull#*:}
|
ContTag=${ContFull#*:}
|
||||||
BackupName="dockcheck/$ContApp:$(date +'%Y-%m-%d_%H%M')_$ContTag"
|
BackupName="dockcheck/$ContApp:$RunTimestamp_$ContTag"
|
||||||
docker tag "$ImageId" "$BackupName"
|
docker tag "$ImageId" "$BackupName"
|
||||||
printf "%b%s backed up as %s%b\n" "$c_teal" "$i" "$BackupName" "$c_reset"
|
printf "%b%s backed up as %s%b\n" "$c_teal" "$i" "$BackupName" "$c_reset"
|
||||||
fi
|
fi
|
||||||
|
|
@ -581,7 +585,7 @@ if [[ -n "${GotUpdates:-}" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker pull "$ContImage" || { printf "\n%bDocker error, exiting!%b\n" "$c_red" "$c_reset" ; exit 1; }
|
docker pull "$ContFull" || { printf "\n%bDocker error, exiting!%b\n" "$c_red" "$c_reset" ; exit 1; }
|
||||||
done
|
done
|
||||||
printf "\n%bDone pulling updates.%b\n" "$c_green" "$c_reset"
|
printf "\n%bDone pulling updates.%b\n" "$c_green" "$c_reset"
|
||||||
|
|
||||||
|
|
@ -644,7 +648,7 @@ if [[ -n "${GotUpdates:-}" ]]; then
|
||||||
backup_date=${backup_tag%%_*}
|
backup_date=${backup_tag%%_*}
|
||||||
# UNTAGGING HERE
|
# UNTAGGING HERE
|
||||||
if datecheck "$backup_date" "$DaysKept"; then
|
if datecheck "$backup_date" "$DaysKept"; then
|
||||||
docker rmi "${repo_name}:${backup_tag}" # || printf "\n%bError removing %s:%s. %b\n" "$c_red" "$repo_name" "$backup_tag" "$c_reset"
|
docker rmi "$repo_name:$backup_tag"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue