https://github.com/hmerritt/backup-script
A simple script that compresses files/folders and moves them to a backup location
https://github.com/hmerritt/backup-script
automation backup bash-script cli compresses-files gzip pigz
Last synced: 10 months ago
JSON representation
A simple script that compresses files/folders and moves them to a backup location
- Host: GitHub
- URL: https://github.com/hmerritt/backup-script
- Owner: hmerritt
- License: apache-2.0
- Created: 2020-04-04T02:14:03.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-28T18:38:36.000Z (about 2 years ago)
- Last Synced: 2023-10-28T19:32:36.714Z (about 2 years ago)
- Topics: automation, backup, bash-script, cli, compresses-files, gzip, pigz
- Language: Shell
- Homepage:
- Size: 62.5 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backup.sh
[](https://travis-ci.org/hmerritt/backup-script)
A simple script that compresses files/folders and moves them to a backup location
## Getting Started
### Install Dependencies
Install script dependencies via `install` argument.
```bash
$ sudo ./backup.sh install
```
#### Bash on Windows
Thanks to `WSL`, you can run bash scripts on windows!
- [Enable WSL (Windows Subsystem for Linux)](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
### Config file
#### Create config
In order to add backups, you need to create a separate config file.
```bash
$ ./backup.sh setup
```
#### Load config
You can load the config file by adding its path after `backup`: `backup `
```bash
$ ./backup.sh
```
> You can have as many config files as you like (this could be used to run different backups)
## Usage
```bash
$ ./backup.sh
```
### Add files/folders to backup
- Open the config file (`backup-config.sh`) and find the *`ENTER FOLDERS TO BACKUP HERE`* text
- Add a file/folder by following the syntax guide below
```bash
# ENTER FOLDERS TO BACKUP HERE
##############################
# backup "name-of-folder" "/directory-of-parent-folder/" "/directory-of-parent-backup-folder/"
# backup "profile-images" "/my/images/" "/my/backup/google-drive/images/"
backup "name of file/folder" "full path to folder" "full path to backup location"
# Lets try a more real example
# We are backing up a folder called "music" that exists in our "documents" folder
# This is then packaged up and moved to the "backup" directory
backup "music" "/home/user/documents/" "/home/user/backup/documents/"
# Original "/home/user/documents/music/"
# Backed-up "/home/user/backup/documents/music.tar.gz"
```