network-backup with windows-linux-samba?

network-backup with windows-linux-samba?

Post by Carsten Nielse » Sun, 21 Jan 2001 00:13:07



hi ng,

I've a LAN including two win- and one linux/samba machines connected via
hub.
Now I'm searching for a small software to backup some 100Megs/day with
following options:

- backup win-directories on linux-drive
- compressing process should run on linux
- complete and incremental backups available
- restore single/selected files (user interface or console?) from client

My first idea was amanda but it seems it only supports tape-drives? (and
Arkeia isn't free...)

Any ideas?

post ya,
Carsten

 
 
 

network-backup with windows-linux-samba?

Post by tonygrof » Tue, 23 Jan 2001 04:25:34


"Carsten Nielsen" <cniel...@sinik.de> wrote in message

news:949lhp$cv3hu$1@ID-60175.news.dfncis.de...

> hi ng,

> I've a LAN including two win- and one linux/samba machines connected
via
> hub.
> Now I'm searching for a small software to backup some 100Megs/day
with
> following options:

> - backup win-directories on linux-drive
> - compressing process should run on linux
> - complete and incremental backups available
> - restore single/selected files (user interface or console?) from
client

> My first idea was amanda but it seems it only supports tape-drives?
(and
> Arkeia isn't free...)

> Any ideas?

> post ya,
> Carsten

In the Dec. 2000 issue of the Linux Journal is an article that shows a
great solution for this. As soon as I read it, I implemented it. All
it requires is Samba and Zip! Very cool. I have been using it for
about 4 weeks now with no problems. It's setup as a weekly cron job to
backup each (2) of my Windowz workstations. Although they only backup
certain directories in the article, I made some minor modifications to
backup each workstation in it's entirety every week, (incrementally of
course, updating only the changed files). The only thing that did not
work right for me was the export PASSWD thing, so I just hardcoded the
passwords to the Win boxes. Yes, it's not real secure, but neither is
Windowz! =). Hope this helps!

Tony G.

Well, if you have an LJ subscription, you can view the article here:
http://interactive.linuxjournal.com/Magazines/LJ80/4360.html

Otherwise, here ya go >>>>>>>>>.
Dec. 2000 Linux Journal

"A Linux-Based Automatic Backup System"
A step-by-step procedure for establishing a backup system that will
save time and money.

by Michael O'Brien
--------------------------------------------------------
Frequently people take computers for granted. This behavior becomes
very dangerous when people rely on a computer to store and manipulate
important data but fail to back up those data. If you are reading
this, then you are probably aware of the need for reliable backups.
However, you may work with people who are not, and your job may be
seriously affected by a loss of their data.

I work in a scientific research group. Our laboratories are modern,
and almost all of our data acquisition is performed by computers
running Windows 95. In essence, our whole business is to acquire
information that is stored on computers. Data loss can end up costing
thousands of dollars, especially when one considers the salaries of
all the people who helped produce that data.

To protect our group from data loss, I proposed an automatic,
network-based backup system for our irreplaceable data. The costs were
negligible (we had a 486/66 computer that was not in use and a 3GB
hard disk that cost us little more than one hundred dollars). I went
through several versions of this system over the past two years,
starting with a Windows 95-based system and ending up with a fast,
powerful Linux-based system. The current version is easy to implement,
inexpensive, powerful and reliable. Assuming you have a networked
Linux machine ready, you should be able to use this article to set up
your own automatic backup system in a short time.

Necessary Tools
All the tools that are needed for the automatic backup system are
included with most Linux distributions. The first is Samba, an
excellent open-source package that allows UNIX-type systems to
communicate with Windows-based systems over a TCP/IP network. The
Linux version includes a utility called smbmount. It uses the smb file
system kernel support unique to Linux, allowing any directories on
Windows computers to be mounted to the Linux file system and
manipulated as if they were on the Linux machine's hard disk. This
will allow the archiving programs (in their update mode) to check to
see if a file on the Windows machine needs to be backed up before it
is transferred through the network, thereby reducing the network
bandwidth requirements, CPU load and hard disk wear dramatically.

There are numerous archiving programs available for Linux, including
tar, bzip2, and even the simple cp command. However, I chose to use
tools from the open-source Info-ZIP project. These tools are included
with most Linux distributions are available for various other
platforms, are fast and small, and use an established file standard
for Windows systems. Furthermore, the compression abilities of the
Info-ZIP tools allow one to significantly reduce the size of the file
archives on the Linux backup system.

Preliminary Steps
Network shares (a hard drive or any directory with all its
subdirectories) must be set up on the Windows computers to be backed
up. If file sharing is not already enabled, you can set it up from the
Windows network control panel. Then, in the Windows Explorer, right
click on the drive or folder you want to access from the network and
choose the Sharing option from the pop-up menu. I recommend allowing
read-only access so that crackers cannot alter or destroy your data if
they somehow obtain your passwords. Make sure to record the names of
these shares. It is a good idea to place the netbios names, DNS names
and IP numbers of the Windows computers in your /etc/hosts file of the
Linux machine (as directed by the comments in /etc/hosts), especially
if your computers lie across different subnets.

Once this is done, you must prepare your Linux system to access and
store the data. First create a mount point for the Windows shares by
typing mkdir /mnt/smb. After that, you must decide where you will put
the archived backups.

I put the backup files on a separate 1GB vfat (Windows) partition that
remains unmounted at all times except when the actual backup processes
are running. This way, the files are protected as much as possible
from file system damage due to power outages, and the hard drive can
be temporarily removed from the Linux computer and put into a Windows
computer to facilitate recovery. In order to accommodate this, I
created a mount point called /mnt/backups.

Scripts
A script is a text file containing commands that one would normally
type at the Linux command prompt. You can use them to easily
accomplish very complex tasks repeatedly. Making a script is as simple
as typing the text into your favorite editor, saving it and then using
the chmod u+x command on the file.

Listing 1 shows the script that backs up the DATA directory from the
d_drive share on the computer named ``higgins''. This script runs on
my Linux computer, ``magnum'', and is stored as the file
root/backup/higgins.

( Listing 1. DATA Directory Backup )
--------------------------------------------------
#!/bin/sh
# This batch file backs up the data from SHARE
# -------------SCRIPT VARIABLES---------------
SHARE="//higgens/d_drive";
DATADIR="DATA";
USERNAME="notneeded"
PASSWD="mjdomo";
BACKUPFILE="higgens_data.zip";
BACKUPDRIVE="/dev/hdc1";
BACKUPMP="/mnt/backups/";
SMBMP="/mnt/smb/";
# ---------------------------------------------
export PASSWD;
echo 'go';
smbumount $SMBMP;
smbmount $SHARE $SMBMP -N -n$USERNAME;
if (ls $SMBMP$DATADIR) then
     echo "Backing up $SHARE";
     mount -t vfat $BACKUPDRIVE $BACKUPMP;
     cd $SMBMP;
     zip -r -u -v $BACKUPMP$BACKUPFILE $DATADIR;
     cd /;
     umount $BACKUPDRIVE;
fi;
     smbumount $SMBMP;
--------------------------------------------------

The first line, while looking like a comment, actually instructs the
computer to use bash to execute the script. Next comes all the shell
variables that the main part of the script will use to back up the
data on higgins. This practice of putting the case-specific values in
variables at the beginning of the script allows the user to make new
versions for new computers very quickly by copying the basic script
and changing a few easily seen values. Listing 2 shows a different set
of variables for a Windows 98 machine (``rick'' with a shared C:
drive) and a Windows NT machine (``tc'' with a shared folder named
``data''). Note how the Windows NT variables need to specify a user
name and the password associated with that username.

( Listing 2. Variables for the Windows Machines )
--------------------------------------------------
# -------------SCRIPT VARIABLES for rick-----------<
SHARE="//rick/rick_c";
DATADIR="Data";
USERNAME="notneeded"
PASSWD="icepick";
BACKUPFILE="rick_data.zip";
BACKUPDRIVE="/dev/hdc1";
BACKUPMP="/mnt/backups/";
SMBMP="/mnt/smb/";
# ---------------------------------------------
# -------------SCRIPT VARIABLES for tc---------------
SHARE="//tc/data";
DATADIR="*";
USERNAME="obrien"
PASSWD="flyme";
BACKUPFILE="tc_data.zip";
BACKUPDRIVE="/dev/hdc1";
BACKUPMP="/mnt/backups/";
SMBMP="/mnt/smb/";
# ---------------------------------------------
--------------------------------------------------

The remaining lines actually do the work. The command export PASSWD
puts the password in an environment variable that the smbmount program
reads automatically. The smbumount command is executed next in case
someone forgot to unmount an SMB share from the mount point. (If there
is nothing there, smbumount returns a harmless error message and the
script continues.) The smbmount program then attempts to mount the
remote share. -N switch instructs it not to ask for a password to
replace the value of the PASSWD environment variable. The -n switch
communicates the username to smbmount.

An if statement checks to see if the specified backup files actually
exist before doing any backup work in case the network may be down or
the remote computer is switched off. In this case the script will
terminate after making the mount point available again.

If the Linux machine can access the remote files, all archiving is
done with the zip command. The -r switch is the standard recursion
option, which makes zip go through every subfolder of the data
directory. The -u puts zip in update mode, where it will only add or
change files that are not already archived or those that have changed.
The -v parameter instructs ...

read more »

 
 
 

network-backup with windows-linux-samba?

Post by Carsten Nielse » Tue, 23 Jan 2001 19:23:52


Hi Tony,

Quote:> In the Dec. 2000 issue of the Linux Journal is an article that shows a
> great solution for this. As soon as I read it, I implemented it. All
> it requires is Samba and Zip!

thanks for submitting the very helpful article. The configuration runs very
well.

But i've not found any option for incremental backup in separate files. Do
you know if zip includes this option (maybe first reset archive-bit and next
time only store files with archive-bit set)? I didn't find anything in the
docs...

Thanks again,
Carsten

 
 
 

network-backup with windows-linux-samba?

Post by tonygrof » Sun, 28 Jan 2001 05:39:50


Carsten, Unless I am not understanding the question correctly, this
should be covered by the -u option in the zip command. That works well
for my purposes.

#man zip
.........
       -u     Replace (update)  an  existing  entry  in  the  zip
              archive  only if it has been modified more recently
              than the version already in the zip  archive.   For
              example:

                     zip -u stuff *

              will  add  any  new files in the current directory,
              and update any files which have been modified since
              the zip archive stuff.zip was last created/modified
              (note that zip will not try to pack stuff.zip  into
              itself when you do this).

              Note that the -u option with no arguments acts like
              the -f (freshen) option.
.............

This also works for me for files that were not there before, but have
been added since the last backup. However I backup directories only,
not specific files. Sorry for the delay in the reply too, freakin
MSN's (yeah, I should know better) news server is total CRAP! I've not
been able to read news for 4 days! Anyhow, hope that does the trick
for you!

Tony G.


Quote:> Hi Tony,

> > In the Dec. 2000 issue of the Linux Journal is an article that
shows a
> > great solution for this. As soon as I read it, I implemented it.
All
> > it requires is Samba and Zip!

> thanks for submitting the very helpful article. The configuration
runs very
> well.

> But i've not found any option for incremental backup in separate
files. Do
> you know if zip includes this option (maybe first reset archive-bit
and next
> time only store files with archive-bit set)? I didn't find anything
in the
> docs...

> Thanks again,
> Carsten

 
 
 

network-backup with windows-linux-samba?

Post by Carsten Nielse » Mon, 29 Jan 2001 01:21:53


Hi Tony,

Quote:> Carsten, Unless I am not understanding the question correctly, this
> should be covered by the -u option in the zip command. That works well
> for my purposes.

Yes it does, but not with incremental backups in seperate files...

Now I've written a perl-script myself, creating a full-backup-archive on
every friday (find with pipe on zip), and writing the date and time of  this
operation in a status-file. For daily incremental-backup the content of this
file is used in the find-command...

Works fine and I can define a conf file for each backup job.

Post'ya
Carsten

 
 
 

1. Can a Linux machine act as a central backup for a Windows 95 network?

I'm in the process of setting up a Linux box and was wondering if its
possible to set it up as a central backup if I connect a DAT drive to
it.

I'm not yet fully sure how well Linux integrates with Windows 95 (I
still haven't checked out Samba) but if I could install a backup
client in Windows (similar to Cheyenne or Arcserve on Novell) which
could systematically backup my Windows machines that would be great.

Does such a thing exist?

Regards,
Jason.

***************
Jason Arthurs ********************************
Bangor        * Think like a man of action,  *
Gwynedd       * Act like a man of thought... *
North Wales   ********************************
***************

2. Uucp

3. Use linux machine to handle automated backups from windows and mac systems on network?

4. Seek information on YAMM

5. Network backup of Linux using Windows NT

6. permissions for apache

7. Logon to Windows NT network from Linux using Samba?

8. Newbie question about ALS100.

9. linux server with samba in a windows network

10. SAMBA, SMB I'm lost and so is my windows 2000 machine on linux network

11. linux server with samba in a windows network

12. Best Free X Windows Server for Win95/98 Box on Samba/Linux Network?

13. Samba, Linux and Windows Network Neighborhood.