LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-20-2009, 02:47 AM   #1
Liane
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
Question Tar backup to NFS share problem


Hi guys

I am a Linux newbie and would like your help please :-)

My server runs on a Linux Red Hat platform. I need to run a tar backup that writes the backup file to an NFS share on a shared Windows network folder.

1. I created a script named fullserver.sh as root in a folder on my Linux server named /bakscripts. I set the permissions to this folder to 777.

2. I then created a folder /mnt/backups that is the folder I will use as mount on my Linux server and gave it permissions 777.

3. The NFS folder where I want the backup in (windows folder on network) has full permissions and are named \\TasIntra01\Backup

My Linux fullserver.sh scripts reads as follows:

#I want to make sure the folder is not mounted first
umount /mnt/backups
#I then mounts the following and it mounts successfully
mount -t nfs 10.10.1.66:/TasIntra01/Backup /mnt/backups
#I then creates the backup (only of the Home directory at first to test
Tar jvc --file /mnt/backups/fullserver.sh /home
#I then unmount the folder afterwards
umount /mnt/backups

4. When I run the script fullserver.sh the following happens:

It mounts /mnt/backups
It starts with the tar backup by removing leading "/" from member names
Halfway through this it gives an error - tar: /mnt/backups/fullserver.tar: Cannot open: Permission denied
tar: Error is not recoverable: exiting now
It then returnes to root prompt.

If I check the folders on all shares, no backup file present.

Could you please help, I'm not sure what I'm doing wrong.

Thanks a mil
 
Old 04-20-2009, 05:11 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
What do you mean by an NFS server on a Windows network folder.
 
Old 04-22-2009, 04:36 AM   #3
Liane
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Smile Answer

I have a Windows server with a nfs folder where the tar backup should write to.
 
Old 04-22-2009, 05:01 AM   #4
Libu
Member
 
Registered: Oct 2003
Location: Chennai
Distribution: Slackware 12.1
Posts: 165

Rep: Reputation: 36
I don't know much about windows NFS. But can you manually write to the /mnt/backups after you do this
Quote:
mount -t nfs 10.10.1.66:/TasIntra01/Backup /mnt/backups
If you cannot, then the script will not work.
If you can and the file is visible via windows explorer then the script will work.

Else check this link:
Note: Like I said, I do not know much about NFS, i just googled to get that link.
 
Old 05-04-2009, 05:57 AM   #5
Liane
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Hi guys

I finally solved it!!

In order to write the backup from Linux Red Hat to a shared folder on a Windows 2003 platform I did the following.

1. Made sure my permissions were set on the Windows server and all folders.
2. Created an executable shell on Linux as follows:

#Make sure the share is not already mounted by unmounting it. My Liux share folders are /mnt/backups.

umount /mnt/backups

#Mount the Windows and Linux shares

mount.cifs //WindowsServerIP/FolderName /mnt/backups -o user:UserName,password=*****

#Start the tar backup, set options, give the filename of the backup and what to backup

tar jvc --file /mnt/backups/fullserver.tar /home

#Unmount the share

umount /mnt/backups

___________________________________________

3. Created a cron job to automatically run the file at specific times.
 
  


Reply

Tags
nfs


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
problem on tar backup kenwong Linux - Software 1 07-27-2008 11:17 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
NFS share problem ElVirolo Linux - Networking 2 02-20-2006 06:16 PM
Tar Backup Problem Damed92 Linux - General 0 09-10-2003 09:00 AM
Tar Backup Problem cli_man Linux - General 0 08-28-2003 01:36 PM


All times are GMT -5. The time now is 09:04 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration