You are not logged in.

#1 2009-07-10 22:55:52

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

nsb: named stage backup

Hello smile

I'd like to share with you a little backup tool. It allows to save different versions of projects at various stages of development. I suspect this isn't very informative. An example, perhaps:

Example 1:
You are playing with your xorg.conf.
Before you start, you want to have a backup of the working version:
  nsb pa xorg                    # create a new project called "xorg"
  nsb fa xorg /etc/X11/xorg.conf  # add xorg.conf to the project
  nsb pbs xorg working      # backup project "xorg" as "working"
After a lot of fiddling, you have no idea where you actually are now. So you decide to get back to what worked and stop losing your time:
  nsb pr xorg  working        # restore the working version
  nsp pd xorg                     # delete the project

Example 2:
You cannot decide if you prefer XMonad or Awesome. You keep commenting and uncommenting bits of your .xinitrc. This can be done easier:
  nsb pa xinit                     # create a new project called "xinit"
  nsb fa xinit ~/.xinitrc        # add .xinitrc to the project
  nsb pbs xinit xmonad       # backup the XMonad version
Now modify your .xinitrc to the Awesome version and
  nsb pbs xinit awesome      # backup the Awesome version
Now whenever you want to switch to XMonad or Awesome, just issue
  nsb prs xinit xmonad
  or
  nsb prs xinit awesome      # restore the appropriate version


You can download nsb from AUR.
Just please REMEMBER: that it's still an ALPHA version and might not work as expected. Do NOT use it as your only backup tool!
If you have any feedback, I'll be very happy to hear from you smile

Offline

#2 2009-07-11 11:05:26

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: nsb: named stage backup

this sounds interesting , but meh i often screw up configuring things . I use svn for my dotfiles so i just revert to my old version

Offline

#3 2009-07-11 20:57:43

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: nsb: named stage backup

jelly wrote:

this sounds interesting , but meh i often screw up configuring things . I use svn for my dotfiles so i just revert to my old version

Sure, if you find it easier.
The problem for me with the systems I've looked at is that they're supposed to, or even trying to record nearly every change you make. This is too detailed for me and I sometimes find it difficult to later find the version I'm looking for. That's why I did these stages which are meant to be made when you reach some concrete point in your work.
I'm not sure if this is clear. Perhaps I should try to find a better example.

Offline

#4 2009-07-12 00:51:45

kanim
Member
Registered: 2007-05-14
Posts: 104

Re: nsb: named stage backup

nice,

i realy like the idea of this caminoix gonna test this out tomorrow. i do often switch betwen configs and this would realy help me

it would be interesting to know where the files get stored and  if i do pbs xorg working and then pbs xorg working would it just overwrite the file without asking or would it allert me that that backup already exists?

Offline

#5 2009-07-12 02:29:18

crouse
Arch Linux f@h Team Member
From: Iowa - USA
Registered: 2006-08-19
Posts: 907
Website

Re: nsb: named stage backup

For really quick backups of files, I created a function for my .bashrc file.

bu () { cp $1 ${1}-`date +%Y%m%d%H%M`.backup ; }

bu xorg.conf

will copy the xorg.conf file and it will look like:
xorg.conf-200907112102.backup
So it backups with filename/year/month/day/hour/minute.backup  --easy for me to tell WHEN i made the backup.
Removing ALL backups in a directory (for cleanup) is as easy as rm *.backup

I normally use RCS, but for quick backups, this works good for me. Thats the cool thing about Linux, you can do things so many different ways, and whatever way works  best for you, well, use that smile 

It appears that you have created sort of a "mini" revision control system for yourself.

Offline

#6 2009-07-12 06:21:47

caminoix
Member
From: cracow, poland
Registered: 2005-07-12
Posts: 162
Website

Re: nsb: named stage backup

kanim wrote:

i realy like the idea of this caminoix gonna test this out tomorrow.

Happy to hear that smile Great you want to test it! As I said, it's an alpha and it really needs testing, especially by someone else than me.

kanim wrote:

it would be interesting to know where the files get stored and  if i do pbs xorg working and then pbs xorg working would it just overwrite the file without asking or would it allert me that that backup already exists?

1. There's a variable in the script called $dirBackup. You'll want to set it to your taste before testing because now it's set to my home smile
EDIT: I've uploaded a second alpha. It shouldn't be set to my home any more. But you might want to check the config file anyway.
2. It should ask before overwriting.

crouse wrote:

So it backups with filename/year/month/day/hour/minute.backup  --easy for me to tell WHEN i made the backup.

See, this is often problematic for me. I just can't remember when I made the change. I only remember what I changed. That's why I need names, not dates.

crouse wrote:

Removing ALL backups in a directory (for cleanup) is as easy as rm *.backup

Well, yes, nbs pd … is pretty easy, too smile

crouse wrote:

It appears that you have created sort of a "mini" revision control system for yourself.

That's one of the reasons that made me write it. When I see huge systems such as RCS, SVN, Git &c., I don't really feel too much like learning them because I know there's such a lot to learn, and it will take so long &c.
Mine's minimalistic by design. Well, KISS smile

Last edited by caminoix (2009-07-12 07:48:45)

Offline

Board footer

Powered by FluxBB