Skip to content

DawnImpulse/github-backup

Repository files navigation

GitHub Backup Script

A cli tool to back up all the user repositories on GitHub

  • Written in : Node Typescript
  • Available for : Linux MacOs Windows
  • Simply run on command line with arguments
  • You can set it up along with cron, task scheduler etc. for auto backups

Installation

Download the latest executable for your machine from Releases

Usage

Run the executable via command line only

./github-backup-win.exe -t abcdefgh  

Options

flag required default description
-p, --path no current working directory provide complete path for where to store backup zip/folder
-nz, --nozip no false whether to zip all the repo together or keep them in a folder only; by default it will zip
-n, --name no backup-{YYYY-MM-DD-HH-mm-ss} name of folder/zip; more details in Dynamic Name
-u, --utc no false use utc timezone for formatting time; default is system
-t, --token YES - user github token with all repo access; more details in Github Token

Dynamic Name

The name of the zip/folder can be dynamic based on current date time. You can provide the dynamic timestamp within {} & it will be automatically parsed to get current values.

  • Always provide the name & path in '' or ""
  • example ./github-backup-win.exe -t abcd -n 'backup-{YYYY}'
  • The timestamp values is based on moment.js ; refer to moment docs for creating timestamp
  • You can have multiple timestamp in name
    • example backup-{YYYY}-xyz-{MM}abxd{DD} will give result backup-2024-xyz-01abxd25

Examples

  • with path
    ./github-backup-win.exe -t abcd -p 'E:\'

  • no zip
    ./github-backup-win.exe -t abcd -nz

  • utc timestamp
    ./github-backup-win.exe -t abcd -n '{YY-MM-DD}' -u

  • with all options (short or long form can be interchanged)
    ./github-backup-win.exe --token abcd --path 'E:\' --name 'backup-{MM}-{DD}' --nozip --utc

Contact

Twitter - @dawnimpulse
Email - [email protected]

The Unlicense

github-backup is free and unencumbered public domain software. 

For more information, see https://unlicense.org/ or the accompanying UNLICENSE file. 

Written with StackEdit.

About

Backup all user GitHub repos with cli

Resources

License

Stars

Watchers

Forks

Packages

No packages published