Tar backup to NFS share problem
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
#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
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
What do you mean by an NFS server on a Windows network folder.
I have a Windows server with a nfs folder where the tar backup should write to.
I don't know much about windows NFS. But can you manually write to the /mnt/backups after you do this
If you can and the file is visible via windows explorer then the script will work.
Else check this link:
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.
#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
3. Created a cron job to automatically run the file at specific times.
|All times are GMT -5. The time now is 08:02 AM.|