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 » 08 Mar 2011, 17:17

Yes I could have programed it to only take the name not the entire path to the home folder. (I don't remember why I did that - maybe I even had a thought of reason)
But you are right that this is not for a regular automated backup. That would require a cronjob (as described further up in this thread).
This one is good for a first run because it will generate the necessary files (In your home directory). The only file I look at these days is backup.log. Just to see when the last backup was made. Those cronjobs run so smoothly in the background that I need the confirmation. :-D

Whar I am a bit curious about is this:
Do you now have a /rolf directory with a set of files on your box? :-D
Thanks for testing it :B :s
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 Sep 2011, 13:12

I have been using this script for 6 months now and it has not let me down once yet. As you may know the computer expert in this house:
Image

Did agree with me that My Book was crap, so he decided to get rid of my 2 TB USB HD for me by tearing it down from the table to the floor - rather dynamically.
(Some say he is a Persian Exotic I say he is a Mogwai :-D ). And he gave me a new 2TB LaCie HD (Porsche design -no less) as a birthday present. The only thing I had to do was to go into backup.sh and alter the name of the Disk. And the cronjob kept running without errors.
My backup.sh

Code: Select all

#!/bin/bash
if [ -e 'ex.txt' ]
then
echo "ex.txt exists"
else
echo '#Here you can put the all the files and directories you do not want to backup. Like the example below:'>>ex.txt
echo '*/.gvfs'>>ex.txt
echo "ex.txt has been created"
fi
if [ -e 'viking.backup' ]
then
echo "viking.backup exists"
else
echo '#Here you can put the all the files and directories you want to backup'>>viking.backup
fi
cd /home/thomas
for i in `cat viking.backup`;
do rsync -azrv --delete --delete-excluded  --exclude-from 'ex.txt'  $i /media/LaCie/thomas-pc_backup/;
echo -n 'Siste backup står nederst:'>>backup.log|date +'%d-%m-%Y klokken %H:%M'>>backup.log
done


Of course I did not have to change anything in ex.txt

Code: Select all

#Here you can put the all the files and directories you do not want to backup. Like the example below:
*/tmp
*/.config/gsmartcontrol/*
*/.cache
*/.gvfs
*/.local/share/tracker

But for good messure i added the directory "Nedlasting" (downloads) to the list like this: */Nedlasting and ran the backup again.
Behold; the Nedlasting directory was not only - not backed up - it was also removed from the backup. So you will not fill up the HD with old garbage :B
and viking.backup

Code: Select all

/home/viking
/etc


And finally noting to change in the cronjob that starts every day at 20:15h

Code: Select all

15 20 * * * /bin/bash /home/viking/backup.sh


So to conclude: This backup is really friendly towards the changing of backup media.
Which is the only new thing here (but it was a good opportunity to brag about the script again :-D )
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 Sep 2011, 23:13

That's a good job, then. Tell Mogwai I was so startled by his picture that he now owes me a new pair of shorts for my birthday!Image
Image

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

Re: Lets make a killer backup tool

Postby viking60 » 22 Sep 2011, 23:35

Well I did - but he looked at me with big surprised eyes and said something like; no one should have to wear shorts!. As far as he is concerned you may send him some cherry yogurt (his favorite) as reward.
Image
:gimme
Or maybe a small yellow canary bird:
Image

:think: Hmm I am not sure if the last request came from Gizmo or Dubigrasu......

...Anyway the backup is good :lol:
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, 12:01

Hey! I finally figured out this github stuff so now you can all contribute via git! +1 Anyway one version (the one you have to integrate and not the one where you are prompted for your data) is now put out there.
Here you are:
https://github.com/viking60/berserk_stu ... ter/backup
:greetings
To pull all the files down to your computer just install git and do some config (optional):

Code: Select all

$ git config --global user.name "Firstname Lastname"
$ git config --global user.email "your_email@youremail.com"
$ git config --global color.ui true
$ git config --global --list


and pull all the files down with

Code: Select all

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

This will create the berserk_stuff directory and the content.
You can also do the config and registration at https://github.com/
To get the changes you must add upstream like this:

Code: Select all

git remote add uppstream https://github.com/viking60/berserk_stuff.git

An then to get the changes from upstream:

Code: Select all

git fetch uppstream


I feel so special - we have our own repository now! :whistle:
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, 14:28

Code: Select all

[rolf@localhost git]$ cd berserk_stuff/
[rolf@localhost berserk_stuff]$ ./configure
bash: ./configure: No such file or directory

:confused

:lolup Some source code is distributed with git and I have used it for building devede, pan2....

Ok, good. :B Now, we have a way to to build Bjoernvold Linux or distribute Norski Public Service Announcements :A
Image

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, 15:11

Those Danes have a tendency to do it everywhere.
I am not sure what your berserk_stuff code is about though :confused
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, 15:14

Ah, just a flippant reply about using git to get source code. Then, to build the software, the usual first step is to run "configure" in the source code directory. :oops:

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, 15:23

OK haven't tried that. I just go straight for

Code: Select all

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

Direct editing of the config files is not recommended AFAICT.
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, 15:37

Yes, I got all the stuff and I see it is your viking backup development. :berserkf
It worked fine; I didn't do the configuration steps, haven't done that before, but it's good to see how that can be part of the process, maybe where some access control is involved, Swedes are everywhere :snooty:

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

Re: Lets make a killer backup tool

Postby dedanna1029 » 21 Jun 2012, 15:42

viking60 wrote:and pull all the files down with

Code: Select all

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

This will create the berserk_stuff directory and the content.

OK, it's always been confusion to me, as to what to do when done with this step. I've never really successfully installed anything from git (but one thing ages ago) because of it. Maybe that's what had rolf, too?

Another thing, I never knew if git should be connected to, and pulled from, as su -, su, regular user, what?

Thanks.
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 » 21 Jun 2012, 16:11

I was just joking. :roll:

I have used git to get source code and build software. In that usage, "configure" is the first step of building the binary from the source and I was just alluding to that process. Here, we can download the repository, which is not source code, so the joke is I tried to "configure".
Maybe we will have some need to use the other capabilities to grow the project, Public Service Announcements, e.g. :wall:

http://git-scm.com/

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.


...su -, su, regular user, what?


Just run the command where you have write privileges. Regular user in your own directories.


Return to “Software”