-   Linux - Newbie (
-   -   Tar backup to NFS share problem (

Liane 04-20-2009 01:47 AM

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 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 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 /mnt/backups
#I then creates the backup (only of the Home directory at first to test
Tar jvc --file /mnt/backups/ /home
#I then unmount the folder afterwards
umount /mnt/backups

4. When I run the script 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

jschiwal 04-20-2009 04:11 AM

What do you mean by an NFS server on a Windows network folder.

Liane 04-22-2009 03:36 AM

I have a Windows server with a nfs folder where the tar backup should write to.

Libu 04-22-2009 04:01 AM

I don't know much about windows NFS. But can you manually write to the /mnt/backups after you do this

mount -t nfs /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.

Liane 05-04-2009 04:57 AM

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.

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