https://github.com/codeby-nurgul/dotbackup
Lightweight Bash tool to back up & restore your Linux dotfiles with GitHub sync, cron automation, and Slack notifications.
https://github.com/codeby-nurgul/dotbackup
backup bash-script cron linux slack
Last synced: 3 months ago
JSON representation
Lightweight Bash tool to back up & restore your Linux dotfiles with GitHub sync, cron automation, and Slack notifications.
- Host: GitHub
- URL: https://github.com/codeby-nurgul/dotbackup
- Owner: codeby-nurgul
- Created: 2025-06-26T14:42:33.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-07T10:59:53.000Z (12 months ago)
- Last Synced: 2025-09-10T13:30:27.070Z (10 months ago)
- Topics: backup, bash-script, cron, linux, slack
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🛡️ DotBackup
**DotBackup** is a lightweight Bash-based tool to back up and restore your Linux dotfiles like `.bashrc`, `.gitconfig`, etc.
It includes:
- GitHub integration for version control
- Cron-based scheduling for daily automation
- Slack notifications to keep you informed
---
## ✨ Features
- ✅ Backup selected dotfiles (e.g. `.bashrc`, `.vimrc`, `.gitconfig`)
- 🔁 Restore these files to a new machine in seconds
- 🌍 Automatically push backups to GitHub
- 🕒 Schedule automatic backups via `cron`
- 🔔 Receive Slack messages when a backup completes
---
## 📁 Folder Structure
```
dotbackup/
├── backup.sh # Backup script
├── restore.sh # Restore script
├── config/ # Where backed-up files live
├── *.log # Timestamped logs (can also be used for cron output)
└── README.md
```
---
## 🚀 How to Use
- 🔁 **Backup your dotfiles**
```bash
./backup.sh
```
This script:
- Copies selected files to the `config/` folder
- Commits & pushes them to GitHub
- Sends a Slack notification on success
- 🔄 **Restore on a new machine**
```bash
./restore.sh
```
---
## ⚙️ Setup
- **Clone the Repository**
```bash
git clone https://github.com/yourusername/dotbackup.git
cd dotbackup
chmod +x *.sh
```
- **Select Files to Back Up**
Edit the `backup.sh` file:
```bash
FILES_TO_BACKUP=(
"$HOME/.bashrc"
"$HOME/.vimrc"
"$HOME/.gitconfig"
)
```
- **Set Your Slack Webhook**
Still in `backup.sh`:
```bash
SLACK_WEBHOOK="https://hooks.slack.com/services/your/webhook/url"
```
---
## ⏰ Automate with Cron
- **Open crontab**
```bash
crontab -e
```
- **Schedule daily backup at 8 PM**
```bash
0 20 * * * /full/path/to/dotbackup/backup.sh
```
> 📌 Use the full absolute path to `backup.sh`
---