Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-12-2003, 10:42 AM
|
#1
|
|
Member
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420
Rep:
|
Script Issue
I've got a backup script that I am running occassionally that I wrote. When I run said script in SSH, it works like a charm. If I run said script in GNOME on the RH8.0 Linux box itself, or through VNC (remote desktop), it will halt the computer pretty much entirely, and I have to reboot. Any suggestions as to why it would work one way and not another? Here is the script:
umask 077
rm -rvf /mnt/backup/*
cp -rdv --no-preserve=ownership /mnt/network/* /mnt/backup/
mkdir /mnt/backup/server
#mkdir /mnt/backup/server/nwn
mkdir /mnt/backup/server/conf
#cp /dservs/nwn/nwnplayer.ini /mnt/backup/server/nwn
#cp -rdv /dservs/nwn/servervault /mnt/backup/server/nwn
#cp -rdv /dservs/nwn/saves /mnt/backup/server/nwn
cp -rdv /etc/samba/smb.conf /mnt/backup/server/conf
cp -rdv /etc/dhcpd.conf /mnt/backup/server/conf
#chown -R root:root /mnt/backup/*
#chmod -R 700 /mnt/backup/*
|
|
|
|
07-12-2003, 10:55 AM
|
#2
|
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
At what point does it hang? try putting some echo stements between the commands so you can see how far it gets.
What are you running it from xterm? Maybe try a different terminal.
|
|
|
|
07-12-2003, 11:16 AM
|
#3
|
|
Member
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420
Original Poster
Rep:
|
You're talking a bit over my head. I'm running ot from the "Terminal Command Line" in GNOME. It seems to hange on the first command. Gets a little ways through the rm command and then dies. I have it running in verbose mode, so I can see what's going on to some extent. What should I do with echo statements? And it *does* run in SSH, for some reason.
|
|
|
|
07-12-2003, 01:27 PM
|
#4
|
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
By "Terminal Command Line" I assume you mean the program called gnome-terminal. I was suggesting using xterm or similar as opposed to gnome-terminal to see if it would work.
I mean setting echo statements like:
echo Setting umask
umask 077
echo Removing old backup
rm -rvf /mnt/backup/*
echo Performaing 1st copy opperation
cp -rdv --no-preserve=ownership /mnt/network/* /mnt/backup/
If it hangs after displaying the first 2 messages then you know that it has hung during the "rm" stage.
|
|
|
|
07-12-2003, 01:28 PM
|
#5
|
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Are you running is as the same user in ssh and gnome-terminal?
|
|
|
|
07-13-2003, 12:00 AM
|
#6
|
|
Member
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420
Original Poster
Rep:
|
Yessir, same user both ways. I don't think the echo statements are necessary since I'm running the rm and cp commands in verbose mode (displayes every copy or deletion). It seems to crash in mid-rm. Any ideas why different shells would react differently?
|
|
|
|
07-13-2003, 08:47 AM
|
#7
|
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
No but I just thought it may be worth a try.
|
|
|
|
07-13-2003, 01:04 PM
|
#8
|
|
Member
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142
Rep:
|
What user are you running this as, is it the same in both cases?
What happens if you run:
chown -R user:group #obviously replace these with the actuals.
chmod -R 700
Before you start mucking with the files?
Flibble
|
|
|
|
07-14-2003, 08:50 AM
|
#9
|
|
Member
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420
Original Poster
Rep:
|
I don't want to change the owners of all the files before I copy them. That would cause all kinds of problems. When I run this script, I always do so root. It works in SSH and not GNOME. I'm assuming that means it's not a permissions problem?
Plus, the way it crashes is strange. It's a copy from an internal HDD to an external USB HDD. When it crashes (or just slows down to an unbelievable crawl, I think), the internal HDD (the one beind copied from) is running continuously, and the USB HDD is doing nothing.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:28 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|