- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script to submit files in a directory
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 12:31 PM
04-06-2002 12:31 PM
script to submit files in a directory
I have a whole bunch of files in a directory that require a command to resend them to various servers, the command is
#su - dssadmin
#connect
#submit file=/tmp/xeSndCube_CC_C_
I want to use a simple script to send them
while [ -f /tmp/xeSnd* ]
do
su - dssadmin
connect
submit file==/tmp/xeSnd*
done
Will the above attempt to submit each of the files individualy ?
I can't test the above as it's a production server
Thanks in advance
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 12:42 PM
04-06-2002 12:42 PM
Re: script to submit files in a directory
It works
I tested it with a bunch of files and just moved them to another directory
Any further ideas will be great
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 12:51 PM
04-06-2002 12:51 PM
Re: script to submit files in a directory
I am wondering is there a reason why you choose su though a script? When I have to transfer files I usualy use rcp. Do you have remsh shell set up? Yuo can test it by doing something like
remsh servera hostname
If that works you can do your rcps like this hostnames.all would be a file with all the hostnames you want to put the file into in one colum.
#! /bin/sh
REMOTES=hostnames.all
for REMOTE in $(cat $REMOTES)
do
echo '#####################'
echo ""
# here you check the hostname of the server this
# is optional
remsh ${REMOTE} -l root "hostname"
#here you copy from your directory to the remote
#server from teh hostnames.all file
rcp -p /home/whatever/file ${REMOTE}:/home/otheruser/
# here we check in the /home/otheruser for the file
remsh ${REMOTE} -l root "ll /home/otheruser/file"
done
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 01:25 PM
04-06-2002 01:25 PM
Re: script to submit files in a directory
I suppose the submit for file in is quite simple. I've been looking into this further
The user dssadmin is a connect direct user
so typing connect from the prompt as the user opens a connect direct session.
Here's the correct scenario
I get an alert saying 'one or more files have not been sent'
I check for file in a directory
/var/local/xe/dss/PROD/logs/connectd
The files that require re submitting are of the same name in /tmp
I then create connect direct session
#direct
submit file=/tmp/xeSnd*
so what would be the correct syntax :-
for file in /var/local/xe/dss/PROD/logs/connectd/xeSend*
do
su - dssadmin
direct
submit file=/tmp/xeSend*
and send the output of each submit to a file
Regards
Steve
for file in /var/local/xe/dss/PROD/logs/connectd
do
su -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 01:30 PM
04-06-2002 01:30 PM
Re: script to submit files in a directory
I'm just going on my break to watch the football
Cheers
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 04:05 PM
04-06-2002 04:05 PM
Re: script to submit files in a directory
Just in case anyone is interested
#!/usr/bin/sh
su - dssadmin
cd $XELOGD/connectd
ls xeSnd* > $XELOGD/connectd/cube
CUBES=cube
for file in $(cat $CUBES)
do
direct
sleep 5
submit file=/tmp/$file >> /tmp/ps.out 2> /tmp/errors
done
Regards
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2002 04:26 PM
04-06-2002 04:26 PM
Re: script to submit files in a directory
Hmmm it doesn't work , i tested it using a file in my ~
cd /home/H092AHE
ls xeSnd* > /home/H092AHE/cube
CUBES=cube
for file in $(cat $CUBES)
do
export $file
direct
sleep 5
submit file=/home/H092AHE/sendit/$file > /tmp/cube.out 2> /tmp/cube.err
done
When It attempts to export $file I get the message
./sendit[6]: xeSndCube_CC_C_
I am going to stop replying to myself now
anyone?
Regards
Steve