LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 07-12-2003, 10:42 AM   #1
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Rep: Reputation: 30
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/*
 
Old 07-12-2003, 10:55 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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.
 
Old 07-12-2003, 11:16 AM   #3
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Original Poster
Rep: Reputation: 30
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.
 
Old 07-12-2003, 01:27 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
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.
 
Old 07-12-2003, 01:28 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Are you running is as the same user in ssh and gnome-terminal?
 
Old 07-13-2003, 12:00 AM   #6
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Original Poster
Rep: Reputation: 30
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?
 
Old 07-13-2003, 08:47 AM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
No but I just thought it may be worth a try.
 
Old 07-13-2003, 01:04 PM   #8
Flibble
Member
 
Registered: Mar 2002
Distribution: Redhat 9.0, Debian, Knoppix, YellowDog
Posts: 142

Rep: Reputation: 15
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
 
Old 07-14-2003, 08:50 AM   #9
gauge73
Member
 
Registered: Jan 2003
Location: Dallas, TX
Distribution: Fedora Core 4
Posts: 420

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
a login script issue asschay Linux - Newbie 1 09-16-2005 02:03 AM
Perl Script issue.... oicdn Linux - Software 2 03-24-2004 10:47 AM
Issue with my backup script gauge73 Linux - General 7 02-23-2004 07:54 PM
issue with shell script chupacabra Linux - General 3 10-18-2002 08:12 PM
Out of guesses! (shell Script issue) chris Linux - General 2 12-10-2001 04:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration