Skip to content

Simple script for moving to target backup by year and month #326

Open
@Doctorf

Description

@Doctorf

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions