MadhavBahl / Control-Yourself

JOIN THE GITTER ROOM: https://gitter.im/Control-Yourself/Lobby Control yourself is a software which helps you reduce distractions by blocking several non-productive websites.
MIT License
17 stars 14 forks source link

Add a script that automatically backs up /etc/hosts #20

Closed Razdeep closed 6 years ago

Razdeep commented 6 years ago

The contributors/users might forget to back up the /etc/hosts file. Why don't we provide a script which would copy the file to another safe location, and rename each backup concatenated with a timestamp?

Feature: Backup and restore for system config files, because safety is important.

MadhavBahl commented 6 years ago

Yes, it is a very good suggestion :smiley: We can do this through a node script itself or a shell script too.

Do you want to work on it @Razdeep I will assign you this issue.

Razdeep commented 6 years ago

Yes, I would love to. @MadhavBahlMD

MadhavBahl commented 6 years ago

Great, for now you can create a separate file inside JavaScript folder (https://github.com/MadhavBahlMD/Control-Yourself/tree/master/JavaScript) named backup.js or backup.sh (depending on whether you want to work with JS or Shell) and add your code in that file. Later I will merge blocker.js and backup.js so that it automatically backs up /etc/hosts whenever we run blocker.js

MadhavBahl commented 6 years ago

Also, if possible go for JavaScript implementation rather than shell, as it will be easier to merge clocker and backup then.