LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-25-2015, 03:52 AM   #1
andrifurious
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Rep: Reputation: Disabled
Advanced backup over network rsync


Hi all, I'm pretty new to Debian and the unix world.

I need your help to run backups using debian (8.2), rsync and crontab to do scheduling.

I have about a dozen of PC/server over a network, my goal would be to make backups of the following machines (some linux some windows) using a PC with debian 8.2 and the rsync package.
Wuold be great to set up some scriptsfor rsync and then using crontab to schedule them.
I would like to perform both "full" and "incremental" backups if possible.

Thank you all for the help!
 
Old 09-25-2015, 07:49 AM   #2
translator1111
Member
 
Registered: Jun 2010
Location: Slovakia
Distribution: Debian 8, Ubuntu 10.04 and 12.04; SLAX 6.0; ConnochaetOS 0.9.; LFS; Natty chip: VT1708S
Posts: 93
Blog Entries: 2

Rep: Reputation: 7
Dear Andrifurius,
first step
rsync /folder source /folder target
see http://linux.die.net/man/1/rsync
tell me if you do not understand anything

second step
call crontab
crontab -u -e file
one way to accomplish your task is to put in file a script where you include the rync

third step
edit crontab to shedule the time of the backup
crontab -e
see:
http://linux.die.net/man/5/crontab
http://linux.die.net/man/1/crontab

Please tell me if you need further help.
 
Old 09-25-2015, 08:38 AM   #3
andrifurious
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you translator1111.

1.Lets make an example:
I have the debian machine and a windows server 2008R2, i need to backup the full W2008R2 Server(C:\) on the debian machine, how should i write the rsync command?

rsynch /ip-or-name-of-w2008r2-server /debianIP-or-name/backups

is that kinda right?

2. How can i put in file a script where i include the rync?

Thank you so much.
 
Old 09-25-2015, 10:15 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,495

Rep: Reputation: 193Reputation: 193
Quote:
i need to backup the full W2008R2 Server(C:\)
I assume you want to be able to do a bare metal reinstall if something happens to your windows server. Windows operating systems need specialized software to do backups capable of restoring the operating system. What you are proposing won't work for that, i.e. using rsync to backup the windows OS to a debian file server. In a mixed windows/linux environment, you are typically just backing up the data on the windows system to a linux file server via samba. Then if your windows OS goes down, you can restore by reinstalling your windows OS from installation media and then restore your data from your backup.
 
Old 09-25-2015, 10:23 AM   #5
andrifurious
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kilgoretrout View Post
I assume you want to be able to do a bare metal reinstall if something happens to your windows server. Windows operating systems need specialized software to do backups capable of restoring the operating system. What you are proposing won't work for that, i.e. using rsync to backup the windows OS to a debian file server. In a mixed windows/linux environment, you are typically just backing up the data on the windows system to a linux file server via samba. Then if your windows OS goes down, you can restore by reinstalling your windows OS from installation media and then restore your data from your backup.
yes thats what i'd like to do, backup full images/pc and some incremental backup of selected directory
 
Old 09-25-2015, 10:32 AM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,495

Rep: Reputation: 193Reputation: 193
You probably would be better off with something like Acronis TrueImage:

http://www.acronis.com/en-us/persona...s-key-features
 
Old 09-25-2015, 10:36 AM   #7
andrifurious
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by kilgoretrout View Post
You probably would be better off with something like Acronis TrueImage:

http://www.acronis.com/en-us/persona...s-key-features
thanks, i'll checkthat out. But what about copying data using a samba share over network? how can i do that?
Sorry im so newbie on linux, i apologize for that.
 
Old 09-25-2015, 11:41 AM   #8
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,495

Rep: Reputation: 193Reputation: 193
The question is so open ended that it's hard to give any practical advice but the place to start is with setting up samba on your debian file server. Books have been written about that. Here's a free online one you can take a look at:

https://www.samba.org/samba/docs/man...TO-Collection/

Once you set that up, the rest is pretty easy. The rsync script for your backup will just be something like:
Code:
#!/bin/bash
rsync <samba mount point for your windows share> <path to backup location on debian>
Then you have to set up the script to run as a cron job. The easiest way to do that is to copy the script to one of the following directories: /etc/cron.daily; /etc/cron.hourly; /etc/cron.weekly; /etc/cron.monthly. You can get more fine tuned control over when the script runs using the crontab command if you need that.

So basically, you have to learn samba configuration, a little bash shell scripting, the rsync command and possibly some nuances of of the crontab command, depending upon what you want to do. Once you have some familiarity with these areas, you can ask some better directed questions and get more helpful responses.
 
Old 09-25-2015, 01:35 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,362

Rep: Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004
You can't do a full system image using rsync over samba, never going to happen. rsync does not do full system images, and samba will screw up permissions and ownership so much that you'd never be able to boot from the backup anyway. If you want a full system image, then you need to use another tool.

If you want incremental and navigable backups of your files, then rsync is a fine tool, but it's not really intended for use with Windows. How do you intend to grab the Windows files? Set up a Windows shared directory, mount it with CIFS on the Linux machine, and rsync over there? Or install an ssh server on the Windows machine using something like Cygwin and rsync the directories of interest over ssh?

The former is going to be a right PITA with multiple machines, user accounts, maintaining security, etc., not to mention it's going to screw up all of your permissions. The latter is more elegant, but ssh server functionality on Windows is kind of a loose cannon in my experience.

Last edited by suicidaleggroll; 09-25-2015 at 01:36 PM.
 
Old 09-28-2015, 02:59 AM   #10
andrifurious
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you all, i never tried to restore a full backup image, but the previous IT tech in my organization used some scripts using cifs and mounting the data on the samba storage using a debian machine. For the incremental backups no problem, it was like you said a "navigable backups of our files" but for the full image i really don't know if he ever restored once.
By the way thank you all for the help, now i have such a better idea of the solution i'm going to use.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync backup to network Drive on single Line LittleMaster Linux - Server 2 08-14-2012 07:32 AM
LXer: Rsync Backup for Windows, Linux Knoppix, and Other Smart Technologies in Handy Backup by Novos LXer Syndicated Linux News 0 12-24-2011 12:43 PM
LXer: Backup with rsync and rsync.net LXer Syndicated Linux News 0 09-14-2010 05:20 PM
Using RSync to backup a secondary off-site backup server pezdspencer Linux - Software 4 06-29-2007 04:40 PM
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 02:13 AM


All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration