Last active
March 23, 2025 02:16
-
-
Save NotYusta/76fd5c2a0491abcf2189b17c3d7f14ab to your computer and use it in GitHub Desktop.
Start Database Backup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DIR_PATH="$HOME/database-backup" | |
OUTDIR_PATH="$DIRPATH/out" | |
CLEAR_PERIOD="7" | |
cd $DIR_PATH | |
# Ensure the output directory exists | |
mkdir -p "$OUTDIR_PATH" | |
# Make sure the backup script is executable | |
chmod +x database_backup_linux_amd64 | |
# Run the backup | |
./database_backup_linux_amd64 | |
# Delete backups older than CLEAR_PERIOD days | |
find "$OUTDIR_PATH" -type f -mtime +"$CLEAR_PERIOD" -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment