Lets make a killer backup tool

What do you have and what do you want?

Moderators: b1o, jkerr82508

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Lets make a killer backup tool

Postby viking60 » 21 Jun 2012, 18:02

Yupp Rolf was joking, he is the guru so he knows this stuff best.
But I might point out that you need to install git from the repo. I might be stating the obvious, but it cannot hurt.....

Code: Select all

sudo apt-get install git

After that you can simply copy and paste the code in your ~/ et voila; berserk_stuff will be created - in other words, just follow the advice of the guru +1
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Lets make a killer backup tool

Postby viking60 » 21 Jun 2012, 18:42

I have even made a wiki now please do tell me if I have been lying to much :-D
https://github.com/viking60/berserk_stuff/wiki/Backup
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Lets make a killer backup tool

Postby rolf » 21 Jun 2012, 20:37

Well, I see the wiki and that is good.

I thought to add this to my local copy and, new to me, guessed to use one of your commands of your initial git post but something is wrong.

Code: Select all

[rolf@localhost ~]$ cd info/bjoernvold/git/
[rolf@localhost git]$ ls
berserk_stuff/
[rolf@localhost git]$ git remote add upstream https://github.com/viking60/berserk_stuff.git
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[rolf@localhost git]$


I have not done any configuring or registering, just used your 'git clone' command to get berserk_stuff/.....

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Lets make a killer backup tool

Postby viking60 » 21 Jun 2012, 21:41

Hmm :think: I take it the cloning went well. and then the upstream command does not work.... I am not sure that everybody can use the enter the upstream command but I thought so.
It looks like you are in the correct path when you enter the command. You could try sending a pull request (hit button on the project page).
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Lets make a killer backup tool

Postby rolf » 21 Jun 2012, 21:52

I issue the command in the parent directory of berserk_stuff

Maybe the git commands are different on Mandrva 2011, in case you are in a different distro.

I also tried in berserk_stuff/ some commands, like git ls-tree and git seems a little less po'ed but not altogether happy:

Code: Select all

[rolf@localhost git]$ git ls-tree -d
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[rolf@localhost git]$ cd berserk_stuff/
[rolf@localhost berserk_stuff (master)]$ git ls-tree -d
usage: git ls-tree [<options>] <tree-ish> [<path>...]

    -d                    only show trees
    -r                    recurse into subtrees
    -t                    show trees when recursing
    -z                    terminate entries with NUL byte
    -l, --long            include object size
    --name-only           list only filenames
    --name-status         list only filenames
    --full-name           use full path names
    --full-tree           list entire tree; not just current directory (implies --full-name)
    --abbrev[=<n>]        use <n> digits to display SHA-1s

[rolf@localhost berserk_stuff (master)]$

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Lets make a killer backup tool

Postby viking60 » 21 Jun 2012, 22:19

I am puzzled. I was going to suggest git fetch upstream but I managed to unwatch my project so now it is gone - I think. Going into fixing mode......
Fixed!
You have tried being in the berserk_stuff directory? And besides that I am drawing blanks right now...
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Lets make a killer backup tool

Postby viking60 » 22 Jun 2012, 09:21

OK here is my Mandriva entry:

Code: Select all

.:[ thomas@thomas-pc : 10:13:55 : ~/berserk_stuff ]:.
:( git remote add uppstream https://github.com/viking60/berserk_stuff.git
.:[ thomas@thomas-pc : 10:19:37 : ~/berserk_stuff ]:.
:) git fetch uppstream
From https://github.com/viking60/berserk_stuff
 * [new branch]      master     -> uppstream/master
.:[ thomas@thomas-pc : 10:19:56 : ~/berserk_stuff ]:.
:)


The ":)" are smileys I get similar errors like you if the

Code: Select all

git remote add uppstream https://github.com/viking60/berserk_stuff.git
is not ran first.
And I do it from within berserk_stuff.

In your case maybe this would help:

Code: Select all

git config --global branch.autosetupmerge true

http://nuclearsquid.com/writings/git-tr ... workflows/
You should also be able to do a

Code: Select all

gitk
in berserk_stuff and get a GUI overview of what is going on.
Image
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Lets make a killer backup tool

Postby viking60 » 22 Jun 2012, 14:56

I have added the guided backup script (the fool prof one :-D ) to the repo. It does the same as backup.sh but it prompts you for the paths and makes the first run easier.
After it is run you can edit viking.backup and ex.txt with whatever you want to backup and exclude.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Lets make a killer backup tool

Postby rolf » 22 Jun 2012, 15:32

I have not yet done any configuration steps and it appears my error came from not running commands in the "master" directory :A

Code: Select all

[rolf@localhost git]$ cd berserk_stuff/
[rolf@localhost berserk_stuff (master)]$ git remote add uppstream https://github.com/viking60/berserk_stuff.git
[rolf@localhost berserk_stuff (master)]$ git fetch uppstream
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 12 (delta 2), reused 12 (delta 2)
Unpacking objects: 100% (12/12), done.
From https://github.com/viking60/berserk_stuff
 * [new branch]      master     -> uppstream/master
[rolf@localhost berserk_stuff (master)]$ ls
backup/  README*
[rolf@localhost berserk_stuff (master)]$ ls -R
.:
backup/  README*

./backup:
backup.sh*  ex.txt*  viking.backup*
[rolf@localhost berserk_stuff (master)]$


Thanks for all your work on this :greetings

User avatar
dedanna1029
Sound-Berserk
Posts: 8784
Joined: 14 Mar 2010, 20:29
Contact:

Re: Lets make a killer backup tool

Postby dedanna1029 » 22 Jun 2012, 17:05

rolf wrote:In that usage, "configure" is the first step of building the binary from the source and I was just alluding to that process.

So, to understand you correctly, as regular user, it is as you have here. Then, once done, in this case, it's already "there", and ready to use?

Sorry on the joke - that shows how little I know about git or the commands for it (I wasn't kidding, hence why I'm trying to understand it now), so it blew right over my head.
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
rolf
Guru-Berserk
Posts: 1107
Joined: 16 Mar 2010, 16:07

Re: Lets make a killer backup tool

Postby rolf » 22 Jun 2012, 18:01

So, to understand you correctly, as regular user, it is as you have here. Then, once done, in this case, it's already "there", and ready to use?


Right. There are several issues. One, git is a way of distributing stuff. To get the stuff, first, as Viking60 pointed out, you have to have git installed on your system. Then, you can use git as a downloader, to download from the repository to your machine. Like other downloaders, you have to have write permissions in the directory where you run the command. In that case, run as regular user in one of your directories under /home will do it. Many of us have data partitions where we have write permission as regular user, that's how we set it up.

What Viking put in his git repository is berserk_stuff/ with files and directories under that. Running the git command he gave will download that directory recursively, like rsync, like making a local mirror of the repo. Getting source code to compile is like that. Once it's on your machine, you can do whatever you want. Viking is talking about other functions of git as a developer tool, such as uploading changes to his stuff or new stuff. That's something new to me but I know that is how software development is done, even kernel development. There are other "distributed version control system"s and I'm not up-to-date on which one Linus is using atm. In that usage, there is another permissions issue as only authorized contributors will be able to upload to the git repository.

The next hurdle for us was running the commands to, essentially, add Viking's git repository as a source for git to fetch changes:

Code: Select all

[rolf@localhost berserk_stuff (master)]$ git remote add uppstream https://github.com/viking60/berserk_stuff.git


As we discovered, this has to be run in the top level directory of the local repository. I see git has control over the shell to change the prompt when I am inside the repository, [rolf@localhost berserk_stuff (master)]$, kinda cool.

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Lets make a killer backup tool

Postby viking60 » 22 Jun 2012, 18:11

rolf wrote:I have not yet done any configuration steps and it appears my error came from not running commands in the "master" directory :A

Code: Select all

[rolf@localhost git]$ cd berserk_stuff/
[rolf@localhost berserk_stuff (master)]$ git remote add uppstream https://github.com/viking60/berserk_stuff.git
[rolf@localhost berserk_stuff (master)]$ git fetch uppstream
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 12 (delta 2), reused 12 (delta 2)
Unpacking objects: 100% (12/12), done.
From https://github.com/viking60/berserk_stuff
 * [new branch]      master     -> uppstream/master
[rolf@localhost berserk_stuff (master)]$ ls
backup/  README*
[rolf@localhost berserk_stuff (master)]$ ls -R
.:
backup/  README*

./backup:
backup.sh*  ex.txt*  viking.backup*
[rolf@localhost berserk_stuff (master)]$


Thanks for all your work on this :greetings


:B That is great feeling I am sure! I am still learning myself (come to think of it - who isn't) Now we have this repo to play with.

@dedanna
git is a magician that interacts with the "sky" (github.com) all you have to do on your end is to install it.
..and then you can test it by typing

Code: Select all

git config --global core.editor "nano -w"

This makes nano the default editor for git, and if you do not get any error messages git works!
Now you are ready to enter the clone command:

Code: Select all

git clone https://github.com/viking60/berserk_stuff.git


PS And Rolf has added a post above and that does explain things way better - as usual +1
And Linus is using Git; he made Git....
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Software”