Automatic • Containerized • Secure • Real-time File Synchronization
Runs everywhere with Docker. Keeps your Google Drive folder & local folder in perfect sync.
- Local → Cloud upload
- Cloud → Local mirror download
- Runs every minute using cron
- Compresses old logs
- Deletes old logs
- Prevents storage bloat
- No cron or rclone setup on the host
- Works identically on macOS / Linux / Windows
- Only syncs changed files
- Works without GUI
- Extremely low resource usage
+------------------------------+
| Docker Container |
|------------------------------|
| Cron + Rclone + Scripts |
+--------------+---------------+
|
Every minute|
▼
+--------------------------+
| autosync.sh |
| Upload local → GDrive |
+--------------------------+
|
▼
+--------------------------+
| rclone sync (mirror) |
| GDrive:backup → local |
+--------------------------+
|
Nightly at 12 AM
▼
+--------------------------+
| logrotate.sh |
| Compress + cleanup logs |
+--------------------------+
AutoSync/
├── Dockerfile
├── README.md
├── entrypoint.sh
├── scripts/
│ ├── autosync.sh
│ ├── logrotate.sh
│ └── crontab.txt
├── drive_folder/ # Google Drive mirror
├── local_folder/ # Upload source
├── logs/ # Script logs
└── .gitignore
git clone git@github.com:AshutoshThings/AutoSync.sh.git
cd AutoSync.sh
docker build -t autosync .
docker run -it --name autosync-container autosync
rclone config
new remote > n
Storage > 18 (for google drive)
client ID > skip
Scope > 1
edit advanced config > n
use auto config > n
config this as shared drive > n
keep this "gdrive2024(whatever name you gave)" remote > y
save this config and for verification of rclone with google drive you will have to execute a command something like this rclone authorize "drive" "eyJzY...." into your computer terminal which will pop up your browser which then you will have to verify with your login credentials then you go back to the termianl and you will get long random text some like this : Paste the following into your remote machine --->
eyJ0b2tlX............2KzA1OjMwXCIsXCJleHBpcmVzX2luXCI6MzU5OX0ifQ
<---End paste
copy this and paste into your terminal to authenticate yourself to rclone.
Test yourself
rclone ls gdrive2024:
If you see files → you're done.
exit
docker start autosync-container
Logs:
docker logs -f autosync-container
autosync.sh
- Uploads changed files
- Writes logs
- Handles network errors
logrotate.sh
- Compresses yesterday’s logs
- Deletes logs older than N days
- Keeps container storage clean
crontab.txt
- Defines all jobs (sync & log rotation)
entrypoint.sh
- Starts cron in the foreground.
- Rclone config stored inside container only
- Tokens can be revoked any time from Google Security Dashboard
echo "hello" > local_folder/test.txt
Within 1 minute:
test.txt should appear in Google Drive.
Add a file in Google Drive → backup folder → it appears automatically in drive_folder/

It is free bro, do whatever you want with it. if you liked this, just give it a star, that's all.