mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 06:25:59 +02:00
ci: sync workflows from main branch (#6730)
This commit is contained in:
@@ -30,7 +30,9 @@ parse_generate_cron_expression() {
|
||||
CRON_EXPR_DAYS="*"
|
||||
CRON_EXPR_MONTHS="*"
|
||||
|
||||
# shellcheck disable=SC2001
|
||||
TIME_INTERVAL=$(echo "${BACKUP_INTERVAL}" | sed -e 's/[hdM]$//')
|
||||
# shellcheck disable=SC2001
|
||||
TIME_UNIT=$(echo "${BACKUP_INTERVAL}" | sed -e 's/^[0-9]\+//')
|
||||
|
||||
if [ "${TIME_UNIT}" = "h" ]; then
|
||||
@@ -74,7 +76,9 @@ parse_generate_cron_expression() {
|
||||
parse_generate_retention_expression() {
|
||||
FIND_TIME_EXPR='mtime'
|
||||
|
||||
# shellcheck disable=SC2001
|
||||
TIME_INTERVAL=$(echo "${BACKUP_RETENTION}" | sed -e 's/[mhdM]$//')
|
||||
# shellcheck disable=SC2001
|
||||
TIME_UNIT=$(echo "${BACKUP_RETENTION}" | sed -e 's/^[0-9]\+//')
|
||||
|
||||
if [ "${TIME_UNIT}" = "m" ]; then
|
||||
|
||||
@@ -17,10 +17,11 @@ main() {
|
||||
fi
|
||||
|
||||
if [ ! -d "${BACKUP_PATH}" ]; then
|
||||
echo "Error: BACKUP_PATH does't exist or is not a directory" 1>&2
|
||||
echo "Error: BACKUP_PATH doesn't exist or is not a directory" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
find "${BACKUP_PATH}/" -type f -name "gogs-backup-*.zip" -${FIND_EXPRESSION} -print -exec rm "{}" +
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user