Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could shallow-backup integrate with git for backup? #57

Closed
jasikpark opened this issue Aug 2, 2018 · 9 comments
Closed

Could shallow-backup integrate with git for backup? #57

jasikpark opened this issue Aug 2, 2018 · 9 comments
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jasikpark
Copy link
Contributor

jasikpark commented Aug 2, 2018

It seems like it would be a great idea to make shallow-backup git aware and if you want it to back up to github.com or some other git remote repository when you run shallow-backup, then the backup is off-device, and it makes it easy to share.

Obviously, it's possible to do this manually, but it is also possible to reinstall all of the packages manually, and yet $ pip install -r pip_list.txt is already included in shallow-copy.

@alichtman
Copy link
Owner

alichtman commented Aug 16, 2018

Is it possible? Absolutely. I think it's a great idea, and something that I explored doing while I was building this.

In terms of functionality, here's some pseudocode (in a mix of python and bash):

$ cd backup_dir

# Initialize git if not already initialized
if ".git/" does not exist in backup_dir:
     git init

else:
    git add .
    git commit -m "Update shallow-backup"
    git push origin master

If you'd like to add this functionality, a PR would be welcomed! I could talk with you some more about how exactly to do this if you were interested.

but it is also possible to reinstall all of the packages manually, and yet $ pip install -r pip_list.txt is already included in shallow-copy.

I'm confused what you meant by this. Can you rephrase it?

@alichtman alichtman added feature New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 16, 2018
@jasikpark
Copy link
Contributor Author

jasikpark commented Aug 17, 2018 via email

@alichtman
Copy link
Owner

alichtman commented Aug 17, 2018

Ahhh gotcha. The whole point of this is to make backups easy. The more you automate, the less there is to accidentally screw up.

Totally behind that idea.

@pulkitmaloo
Copy link

I think this is a great idea as currently backing up to a git repository deletes all the files including the .git folder.

@alichtman
Copy link
Owner

alichtman commented Oct 12, 2018

Just opened a separate issue for that bug: #68. (FOLLOW UP: This bug could not be reproduced. The .git and .gitignore files are currently maintained by shallow-backup.)

Once that is done, this shouldn't be too much work to complete.

@pulkitmaloo
Copy link

Thanks @alichtman.

Also, is there an option to exclude private files? For example I noticed that it also backs up my private and public ssh-keys which I don't want to backup in the case where I'm pushing the files to a github repository.

If I'm not wrong, there can be two solutions for this

  1. Option to exclude files and don't back up those files at all
  2. Add files to .gitignore so that they can be backed up on a local directory but will not be added to github repository.

I believe the first one can be implemented and second one user can do it by themselves.

@jasikpark
Copy link
Contributor Author

jasikpark commented Oct 12, 2018

It seems like it would be good to have reasonable defaults for preventing private information to be uploaded - the good thing is that Github already has software that removes private information from commits, but it would be better to never upload them.

https://help.github.com/articles/removing-sensitive-data-from-a-repository/

@alichtman
Copy link
Owner

I was imagining that these would be backed up in a private repo, so sensitive data could be backed up without worry, but this is a fair point.

I think we should have an extra prompt for asking if the user wants to back up private data or not (like .ssh/)

Let's have that default to not backing up sensitive files, with yes as the secondary answer.

@alichtman
Copy link
Owner

Follow up discussion in #71

alichtman added a commit that referenced this issue Oct 15, 2018
Closes #57
Progress on #71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants