- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- file move
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
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
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
03-12-2014 08:34 AM - last edited on 03-12-2014 08:25 PM by Lisa198503
03-12-2014 08:34 AM - last edited on 03-12-2014 08:25 PM by Lisa198503
file move
for HOST in `cat /tmp/newhostdetails.txt` -- #since i am running from other OS ,I used evil cat.
do
echo $HOST
echo "#########"
ssh -q -o ConnectTimeout=60 user@$HOST ls -l /tmp/*.02.19.2014.output.tar.gz
if [ $? -ne 0 ]; then
echo "host $HOST not responding"
STAT="*file not available*"
else
echo "host $HOST responding"
STAT="*file available*"
scp -p user@$i:/tmp/*.02.19.2014.output.tar.gz /tmp/deout
if [ $? -ne 0 ]; then
echo "tar output not colletced"
TARSTAT="*not collected*"
else
echo "tar output collected"
TARSTAT="collected"
fi
echo "|${HOST} ${STAT} ${TARSTAT}|" >> /tmp/deoliteoutput.txt
fi
done
------------------>
I am using the above script to check *.02.19.2014.output.tar.gz.
if file name "*.02.19.2014.output.tar.gz" exists it has to scp the file to /tmp/deout.
but i am getting the error at scp -p user@$i:/tmp/*.02.19.2014.output.tar.gz /tmp/deout
$i is not read at line scp -p user@$i:/tmp/*.02.19.2014.output.tar.gz /tmp/deout.
P.S. This thread has been moved from HP-UX>Languages and Scripting to LInux > sysadmin. -HP Forum Moderator
- Tags:
- variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2014 09:28 AM
03-12-2014 09:28 AM
Re: file move
Where are you setting 'i' ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2014 11:18 AM
03-12-2014 11:18 AM
Re: file move
You say "for HOST in ..." but then use $i in your SCP / SSH commands. You should probably use $HOST