Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup Linux to windows server

Status
Not open for further replies.

RadioX

IS-IT--Management
May 15, 2001
145
US
I have a backup server that I use to backup all my machines. Most of them are windows 2k so it works fine. Now we have implemented some Linux based servers. Is there any software out there that will allow me to backup this server to my windows based machine.

Thanks
Ron
 
If you have Samba running, you can mount the Linux drive from the Windows box and back up the files. You will need to make your "administrator" user (or whatever user you log in as to do backups) a "root" equivilant so it will have full permissions on the target server.
Dan
 
Hi,
yeah, you can easily take the backup of files from linux server to windows. The procedure is like this ..

make any folder on windows sharable. Use smbmount to mount that folder and then take the backup.

here is the sample script for the same purpose .. hope this may help you :)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


1.Replace NTUsername with network id and NTPassword with network password.
2.Make the folder shared where you want to take the backup. You should give the full access to that network login ID.
3.The owner of this script should be root.
4.Be sure that, smbd and nmbd are running. If not, start them.
5.If normal user wants to run this script, then be sure that the setUID bit is set for /usr/bin/smbmnt.
6.Add proper values for DIRTOARCHIVE, MNTPOINT, and ARCHIVETO.
7.Modify the smbmount command parameters as per your requirement.

#########################################################

#!/bin/sh
#
# Script to backup the /home volume

ADMINID="NTUsername"
ADMINPASSWD="NTPassword"
DAY=`date +%Y%m%d-%H%M`
BACKFILE=<ProjectName>.source.$DAY.tgz
LOGFILE=/tmp/$DAY.backup.log
STARTTIME=`date`
DIRTOARCHIVE=<Directory path to archieve >
MNTPOINT=<Some directory having all permission >/forBackup$DAY
ARCHIVETO=$MNTPOINT/Source/Archive

# First umount and then mount.
###############################
umount $MNTPOINT
mkdir $MNTPOINT

smbmount <//Windows NT server/Folder for backup> $MNTPOINT -o username &quot;$ADMINID/<workgroup>%$ADMINPASSWD&quot;

# Generate the backup file
###############################
cd $ARCHIVETO

if [ `pwd` != &quot;$ARCHIVETO&quot; ]
then
echo &quot;Aborting backup&quot;
umount $MNTPOINT
rmdir $MNTPOINT
exit 2
fi

{
echo &quot;\n\n&quot;
date
echo &quot;Archiving $DIRTOARCHIVE\n&quot;
echo &quot;The backup file is $BACKFILE\n&quot;
echo &quot;Logfile is $LOGFILE&quot;
tar -cvzf $BACKFILE $DIRTOARCHIVE

echo &quot;End of tar process....&quot;

} >| $LOGFILE

# Unmount
###############################
cd /
umount $MNTPOINT
rmdir $MNTPOINT


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

regards,
Mahesh
 
If you copy files from a Linux server to a Windows server and then back to the Linux server again, the file permissions will be messed up. Windows destroys Linux file permissions when you copy them to a Windows server. The best way to back this up would be to create a cron job that will tar the selected directories on the Linux server into a single tarball each day. Then all you have to do is backup the single .tar.gz file from Windows via a Samba share. Easy enough?

ChrisP
MCSE (2K/NT4), CNE (NW5), CCNA, Linux+, Server+, i-Net+, Network+, A+, CIWA
 
I'd say the BEST way is to not do it- back up the Windows to Linux instead.

I never saw a Windows backup program I liked very much- including the big fancy expensive ones.

Tony Lawrence
SCO Unix/Linux Resources tony@pcunix.com
 
pcunix, what about when he wants to restore his Windows files from the Linux server? Won't the permissions be broken?

My recommendation is to tar them on the Linux box using a cron job and back them up to the Windows server via Samba. That way, you will only have to back up one file and you won't break any permissions.

Also, if you are running something like Backup Exec for Windows, you can download the Unix Agent which will preserve all file permissions. This way, you can back up your Linux box just like you would a Windows server.

ChrisP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top