News:

If you are a member of the Team on BOINC you still need to register on this forum to see the member posts.  The posts available for visitors are not posted to much by members.
 Remember to answer the questions when Registering and also you must be a active member of Team BOINC@AUSTRALIA on BOINC.

Main Menu

Linux command line

Started by Dingo, August 21, 2013, 10:45:18 PM

Previous topic - Next topic

Dingo

Hi all the Linux gurus out there.  I need a script or the commands to compress folders and back them up on another PC.  Hopefully only selecting files that have changed once a complete backup is done.

I have spent a couple of days setting up my server on one of the sshVM servers and would like to have some sort of backuo so if they go down and loose it all I can start it up again quicker.


A complete compress of the whole server would do......


Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

Dingo

I also have my web site now running off dingo3, so there are two servers running the web site.  On the footer of the page it will tell you which one you are attached to ((Debian 6 Server on sshVM Los Angeles)) is the new one.

I still have a couple of problems to work out before I can turn the one at home off and if I can't work them out I may have to abandon the idea of the server running from LA.



Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

dcarrion87

#2
Hey Dingo

I actually use rsync to achieve such things and its very common for backup. Assuming you'll be initiating the backup from a PC at home, you can do a simple pull of new files using "rsync -ax rsync://dingo3.some.domain/var/www /local/backup/folder/for/dingo3". You can then zip it up locally or move them away to do another full backup.

Rsync does the whole "getting differences only" thing. It also has compression you can turn on with "-z".

Let me know if this suits and I can work to get a script together for you. Assuming you'll use the pull method, I suggest you install the rsync daemon on the LA hosts. What goes in the rsyncd.conf file on the server depends on what files you want to be accessible remotely. You'll then want to install the rsync client somewhere (assuming at home) where we can setup a script that runs every so often to pull files down. Achieving full/incremental type backups is just a matter of clearing out the staging point where you pull down files.

Rsync is multi-platform so doesn't matter where you install at home. I.e. It's available for Windows, Linux and Mac.

To do a restore, you can just install the rsync daemon on the host and push the files. I.e. "rsync -ax /local/backup/folder/for/dingo3 rsync://dingo3.some.domain/var/www".

In terms of security, you can tunnel the rsync via an ssh session. E.g. "rsync -axz -e ssh backup@dingo3.somedomain:/var/www /local/backup/folder/for/dingo3". Just need to set up SSH keys.

Sorry, a bit unorganised here but typing as I was thinking.

Cheers

Daniel

Dingo

Hi Daniel

I had a go at using tar to create a gz file then used scp to move it from LA to my home computer.  rsync looks better as it does the compare thing and if it runs on windows I will not have to have my Linux VirtualBox running.

I will have a go at setting something up and give you a yell if I get it to work, or not.   If I figure it out from your post I will have to use my grey matter as opposed to just asking you yo do it.

I also got the couple of problems to work on the server in LA so I can turn the one at home off if all works well tonight at midnight.


Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

dcarrion87

Hey Dingo,

No worries. Yeah give it a crack and feel free to yell out if you get stuck.

If you search "rsync windows" there's a couple of GUI interfaces as well. Probably just as easy to have a batch file running a couple of rsync/move commands attached to Windows scheduler.

Just remember that if you decide to run rsync using it's native protocol (instead of SSH tunnelled) you might need to open the port on the LA server - That's if this server had iptables configured from that BOINC set up script I linked. As root that would just be a matter of:

iptables -A INPUT -p tcp -m tcp --dport 873 -j ACCEPT
iptables-save > /etc/iptables/rules


You can substitute that iptables rule to include a source address so it's only your home IP that's allowed to transfer using rsync. This can also be done in the rsyncd.conf file as well:

iptables -A INPUT -p tcp -m tcp -s 55.55.55.55 --dport 873 -j ACCEPT

Good luck and give us a yell if you need a hand.

Cheers

Daniel

Dingo

sent you a PM I got lost  :sg1:


Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA