This repository contains a collection of useful Bash scripts for e.g. managing Docker containers and performing system tasks. These scripts simplify backup, restore, installation, and updates for Docker, and linux systems in general. Additionaly there are some usefull utility scripts.
Script Name | Parameters | Description |
---|---|---|
install-docker.sh |
Installs Docker on a Linux system. | |
backup-docker.sh |
{DOCKERCOMPOSE-PROJECTNAME} {BACKUPDIR:/mnt/backup/} {BACKUPDURATIONDAYS:2} | Creates a backup of a single Docker container. |
backup-docker-all.sh |
{BACKUPDIR:/mnt/backup/} {BACKUPDURATIONDAYS:2} | Creates backups of all running Docker containers. |
restore-docker.sh |
{BACKUPDIR:/mnt/backup/} | Restores a Docker container from a backup file. |
update-docker.sh |
{DOCKERCOMPOSE-PROJECTNAME} --auto={y,n,b} | Updates a single Docker container. Autorestart = yes, no, with backup |
update-docker-all.sh |
Updates all Docker containers with --auto=y | |
update-scripts.sh |
Updates this scripts collection itself. | |
update-system.sh |
-y (optional: reboot automaticly) | Performs all Linux system updates and also updates the scripts itself and makes a reboot if needed. |
show-lastreboot.sh |
Displays the last system reboot time. | |
link.sh |
Creates symbolic links for all scripts in this collection. | |
wol.sh |
Sends a Wake-on-LAN packet to a device on the network. |
- Create Folder:
sudo mkdir -p /usr/bin/datacore/bash
- Clone the Project:
git clone https://github.com/dataCore/bash-scripts-collection.git /usr/bin/datacore/bash/
- Execute the Script-Linker:
bash /usr/bin/datacore/bash/link.sh
- Test it:
show-lastreboot
To automate the scripts, you can use 'crontab -e' to backup e.g. each day at 03:23 and update the system and all docker-compose each wednesday at 05:03
# m h dom mon dow command
23 03 * * * backup-docker-all '/mnt/backup' 0 > /var/log/dataCoreBackupScript.log
23 05 * * 03 update-system -y > /var/log/dataCoreUpdateScript.log
43 05 * * 03 update-docker-all > /var/log/dataCoreUpdateDockerScript.log