ManagerJay
IS-IT--Management
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 "/hdd2/$Backup_Name" "$Backup_Name"
bye
SCRIPT`
#
# delete the archive
wait
rm -fv "/hdd2/$Backup_Name"
#
#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 "/hdd2/$Backup_Name" /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
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 "/hdd2/$Backup_Name" "$Backup_Name"
bye
SCRIPT`
#
# delete the archive
wait
rm -fv "/hdd2/$Backup_Name"
#
#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 "/hdd2/$Backup_Name" /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