Open
Description
Hi team. Here is a simple script for moving target backup to a new directory by year and month:
File /scripts.d/target.sh
:
#!/bin/bash
# Debug mode
if [[ -n "$DB_DUMP_DEBUG" ]]; then
set -x
fi
YEAR=$(date '+%Y')
MONTH=$(date '+%m')
new_name=$(date -u +"%Y-%m-%dT%H_%M_%SZ")
# Create new directory and return new name
mkdir -p ${DB_DUMP_TARGET}/${YEAR}/${MONTH}
echo -n "${YEAR}/${MONTH}/df_api_backup_${new_name}.tar.gz"
Could you please check this script and add to repo as sample and to docker hub page?
It's a simple solution, but I can't find this example. Maybe it will be helpful.
Metadata
Metadata
Assignees
Labels
No labels