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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar failing

Status
Not open for further replies.

ManagerJay

IS-IT--Management
Jul 24, 2000
302
US
I have developed a script that basically tars the contents of the /hdd2/users directory and its contents. Then the file is ftpd to our HQ office so it can be backed up each night. Since there are only three users at this site, it worked beautifully.

Following is the script I am using.

#!/bin/bash
###################################################################################
# Backup the user's home directories and transfer the information to HQ
# for backup nightly.
#
# FTP is used for the transfer.
#
#
#
# Revision Log
#Original Version - 27 February, 2002 - Jay Hall, Missouri NEA
################################################################################
#
# create a new tar file name based on the date and the computer name
#
Backup_Name=`date | cut -c 1-3,5-7,9-10,25-28`.$HOSTNAME.tgz
#
# create the tar file and zip it
#
tar -czf "/hdd2/$Backup_Name" /hdd2/users/
#
# connect to the ftp server and send the file
#
` ftp -n -i A.B.C.D <<SCRIPT
user XXXXXXXXXXX YYYYYYYYYY
bi
put &quot;/hdd2/$Backup_Name&quot; &quot;$Backup_Name&quot;
bye
SCRIPT`
#
# delete the archive
wait
rm -fv &quot;/hdd2/$Backup_Name&quot;
#
#EOF

When the script is run, I receive the following error:

Red Hat Linux release 7.2 (Enigma)
Kernel 2.4.7-10 on an i586
login: hallja
Password:
Last login: Wed Oct 30 10:24:49 from MNEA-KANSAS_CITY
[hallja@MNEA-SPRINGFIELD hallja]$ su
Password:
[root@MNEA-SPRINGFIELD hallja]# /hdd2/scripts/backup.scr
tar: Removing leading `/' from member names

gzip: stdout: No space left on device
/hdd2/scripts/backup.scr: line 21: 20533 Broken pipe tar -czf &quot;/hdd2/$Backup_Name&quot; /hdd2/users/
removing `/hdd2/WedOct302002.MNEA-SPRINGFIELD.tgz'

Permissions of /hdd2/users/ is 770 and the owners are root.root. Each of the users owns their own directory, but root should still have access right?

df shows that 26% of the free space on /hdd2 is used.

I am running RedHat 7.2 on a P-233 with 64 MB of RAM, 4 GB HDD for the OS (36% used) and and 20 GB HDD (hdd2) for data.

This same script runs on other computers just fine so I am guessing it is something with the premissions on /hdd2/users directory, but I have been unable to find it.

Any suggestions would be greatly appreciated.

Thanks in advance.


Jay
 
I have a feeling that tar-ring into directory which you are backing up may lead to recursive problem. Try different location for your archive.
 
I just found the problem. I ran fsck against the volume and it corrected several errors. Everything is working again.

Thanks for your help.



Jay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top