Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

proffapt/gsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note I have lost interest in bash at this point of time, been doing this too much that it has become toxic for my health and career, so this project is being discontinued from my side. And, this project was a fun project - rather use cronjobs to achieve what it was doing ¯\_(ツ)_/¯. It won't have all the logs and service like features but those aren't needed anyways, if they are anyhow then you always have this tool available right here.

Contributors Forks Stargazers Issues MIT License LinkedIn

gsync

Automate the unique process(by me) for syncing your configuration from your local machine to github.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. Change.log
  6. License
  7. Contact
  8. Acknowledgments

About The Project

GSYNC is a tool for those who like to sync their configuration files in real-time to github, so how does it exactly do that? Read the code for detailed understanding.. from v1.2.1 it can be managed as if it is a kind of a service and has beautiful logs for every folder being monitored

TIP: Use it as a editor alias to open your fav editor and create your configuration file, it will do the job of syncing it to your github and automate this process for future use after you are done editing it.

(back to top)

Why linking config files ?

  • Suppose you wanna sync your .bashrc in ~/, you will have to git init your ~/ which will show everywhere (main) in your terminal and might clash with your sub directories which are some local git projects, so yeah just move it somewhere else.. link that to original location and sync the file now

(back to top)

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

You will need to install the following dependencies for the project to work.

  • fswatch for macOS; inotify-tools for GNU+Linux
  • coreutils
  • git
    git config pull.rebase true
    git config credential.helper store
  • gh
    gh auth login
    gh auth refresh -h github.com -s delete_repo

(back to top)

Installation

Now since we are done with the setting up of environment suitable for the project to compile/run, let's install and configure the project on your system locally now.

  1. Clone the repo.
  2. Make the script executable.
  3. Add suitable alias for it.
    git clone https://github.com/proffapt/gsync.git
    cd ./gsync
    chmod +x ./gsync
    echo "alias gsync='$PWD/gsync'"
  4. Add the echoed line to your shell config file.
  5. Finally, source your config file

(back to top)

Usage

  1. Execute the help menu for script
    gsync
  1. Use cases for the script are as follows:
  • Create mode

    gsync create -c ~/config.file  -g ~/configs
  • Delete mode

    gsync delete -c ~/config.file  -g ~/configs
  • Default mode

    gsync default -g ~/configs
    gsync create -c ~/config.file
    gsync delete -c ~/config.file
  • Logs management

    gsync clear-logs -g ~/configs
    gsync clear-logs -g configs
    gsync clear-logs -g all
    gsync logs -g ~/configs
    gsync logs -g configs
    gsync logs
  • Service management

    gsync start
    gsync selective-start
    gsync stop
    gsync selective-stop
    gsync restart
    gsync status
    gsync enable
    gsync disable
  • [BONUS] Folder Syncing :)

    gsync create -c ~/random.file -g ~/folder_to_sync
    rm ~/folder_to_sync/random.file ~/random.file
  1. Now if you used create mode, edit your configuration file(config.file here), the syncscript will do it's job and sync the configuration file to specified github repo.

* See output screenshots of various cases in images folder.

(back to top)

Contact

📫 Arpit Bhardwaj ( aka proffapt ) - proffapt's Twitter proffapt's Telegram proffapt's LinkedIn proffapt's mail proffapt's forum for cybernity

(back to top)

Acknowledgments

(back to top)

Miscelleneous

Do consider looking at other paradigms of this documentation

(back to top)