Skip to content

datsforge/datsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datsync

datsync is a lightweight Bash tool for syncing data between your local machine and external devices — specifically Android devices (via ADB) and USB drives — with optional mirroring and persistent configuration.

🔧 Because backups should be simple, fast, and smarter than your average sync script.


✨ Features

  • Push/pull files between local ↔ Android/USB
  • Supports both Android internal (/sdcard/) and external (/storage/) storage
  • Mirror mode: deletes files not present in the source (careful now)
  • Supports short options: -an (android-internal), -ax (android-external)
  • Persistent config – remembers your paths and preferences
  • Designed for Linux

📦 Installation

Just drop it somewhere in your PATH:

chmod +x datsync.sh
mv datsync.sh datsync        # Remove .sh extension
sudo mv datsync /usr/local/bin/

Then run it like:

datsync --help

Also configure the target path as you like, defaults are :

  • LOCAL_PATH="$HOME/backups/sync/local"
  • OUT_PATH="/backups/sync/local"
datsync --configure

🧪 Example Usage

Push to Android internal:

datsync push android internal

Pull from Android external:

datsync pull android external
# or the short way:
datsync pull -ax

Mirror push to USB (deletes files on USB not in local):

datsync push-m usb

Mirror pull from Android internal:

datsync pull-m -an

Prompt for storage if not specified:

datsync push android

🛠 Command Overview

datsync <mode> <-target> [storage] [options]

Modes

Command Description
push Push files from local to device
pull Pull files from device to local
push-m Push with mirroring (removes target files not in local)
pull-m Pull with mirroring (removes local files not in target)

Targets

  • android – requires ADB
  • usb – any mounted USB device path

Android Storage Options

  • android internal or -an – for /sdcard/
  • android external or -ax – for /storage/XXXX-XXXX/
  • android all or -aa – do both

⚙️ Options

Flag Description
-c, --config Set or update default paths
-h, --help Show the help message

🧠 Tips

  • Mirror mode (push-m, pull-m) removes files. Don’t be reckless.
  • When syncing to Android and no storage is specified, you'll be asked.
  • Default paths are remembered once set using the --config, (saved in $HOME/.config/datsync.conf).
  • It is recommended to create the same directory for the source and target.
  • Backup path is automatically created in usb if it does not exist.

🔚 Final Words

Backups shouldn't be annoying, and scripts shouldn't require a PhD in rsync.
datsync is your minimalist, no-BS companion for daily backups — fast, predictable, and just smart enough not to get in your way.

Now go sync like a legend.

About

Lightweight Bash tool for syncing data between local machine and external devices

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages