![]() |
![]() |
Simple bash scripts for creating backups and sending them to Telegram.
To use any script, make the file executable:
chmod +x backup-folder.sh
chmod +x backup-docker-volume.sh
chmod +x backup-docker-postgres.shYou must specify the backup name and path to the directory.
Usage:
backup-folder.sh <backup_name> <directory_path>Examples:
backup-folder.sh Name ./images
backup-folder.sh "Few words" /var/log/nginxYou must specify the volume name. The script will automatically check if it exists.
Usage:
backup-docker-volume.sh <docker_volume>Examples:
backup-docker-volume.sh pg-data
backup-docker-volume.sh random-volume # Docker volume does not exist: random-volumeYou must specify the container name (or id), database name, and user name.
Usage:
backup-docker-postgres.sh <postgres_container> <db_name> <db_user>Examples:
backup-docker-volume.sh 5cee88979da6 my-database my-user
backup-docker-volume.sh random-name db user # Docker container does not exist: random-nameWarning
When backing up a directory or a Docker volume, the data may be actively modified at the time of backup (for example by an application, service, or database).
In such cases, the backup:
- may contain partially written files
- may become inconsistent
- may fail to restore correctly later
![]() |
![]() |



