HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- FTP PROBLEM
Operating System - HP-UX
1842897
Members
2849
Online
110210
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
06-29-2006 12:48 AM
06-29-2006 12:48 AM
I am building a script that produces some reports and then FTP’s the reports to a different server. I am using grep to grab some of the file names that I need in to a variable. But when I run the program in CRON it will not move the files with the variable. When I run it manually it works great! Please help!
export FLE1=`/bin/grep "PLAN/STATUS PART I " /tmp/stf91.tmp | /usr/bin/cut -c66-
80`
export FLE2=`/bin/grep "PLAN/STATUS PART II " /tmp/stf91.tmp | /usr/bin/cut -c66
-80`
echo "##FTP AFCOS DATA ########################################################"
/usr/bin/ftp -i -n 55.55.555.55 << !!
quote user michy
quote pass mouse
cd /afcos
put /webdata/comp/ordreg30.txt ordreg30.txt
put /webdata/comp/ordreg90.txt ordreg90.txt
put /comp/print/stanfins/$FLE1 finplan1.txt
put /comp/print/stanfins/$FLE2 finplan2.txt
bye
!!
export FLE1=`/bin/grep "PLAN/STATUS PART I " /tmp/stf91.tmp | /usr/bin/cut -c66-
80`
export FLE2=`/bin/grep "PLAN/STATUS PART II " /tmp/stf91.tmp | /usr/bin/cut -c66
-80`
echo "##FTP AFCOS DATA ########################################################"
/usr/bin/ftp -i -n 55.55.555.55 << !!
quote user michy
quote pass mouse
cd /afcos
put /webdata/comp/ordreg30.txt ordreg30.txt
put /webdata/comp/ordreg90.txt ordreg90.txt
put /comp/print/stanfins/$FLE1 finplan1.txt
put /comp/print/stanfins/$FLE2 finplan2.txt
bye
!!
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 12:56 AM
06-29-2006 12:56 AM
Solution
Shalom,
cron has no envrionment at all.
env > /tmp/normalenv.txt
then add this to your cron job.
env > /tmp/cronenv.txt
let cron run it.
diff /tmp/cronenv.txt /tmp/normalenv.txt
Best to have all commands in full path mode when running in cron.
Working template:
ftp -i -n $dbserver<<-FTP
user $username $password
cd $archpath
dir . file_list
bye
FTP
SEP
cron has no envrionment at all.
env > /tmp/normalenv.txt
then add this to your cron job.
env > /tmp/cronenv.txt
let cron run it.
diff /tmp/cronenv.txt /tmp/normalenv.txt
Best to have all commands in full path mode when running in cron.
Working template:
ftp -i -n $dbserver<<-FTP
user $username $password
cd $archpath
dir . file_list
bye
FTP
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 01:09 AM
06-29-2006 01:09 AM
Re: FTP PROBLEM
export FLE1=$(/bin/grep "PLAN/STATUS PART I " /tmp/stf91.tmp | /usr/bin/cut -c66-80)
echo ${FLE1} > /tmp/stf91-f1.tmp
export FLE2=$(/bin/grep "PLAN/STATUS PART II " /tmp/stf91.tmp | /usr/bin/cut -c66-80)
echo ${FLE2} > /tmp/stf91-f2.tmp
echo "##FTP AFCOS DATA ########################################################"
/usr/bin/ftp -i -n 55.55.555.55 << !!
quote user michy
quote pass mouse
cd /afcos
put /webdata/comp/ordreg30.txt ordreg30.txt
put /webdata/comp/ordreg90.txt ordreg90.txt
put /comp/print/stanfins/$(cat /tmp/stf91-f1.tmp) finplan1.txt
put /comp/print/stanfins/$(cat /tmp/stf91-f2.tmp) finplan2.txt
bye
!!
echo ${FLE1} > /tmp/stf91-f1.tmp
export FLE2=$(/bin/grep "PLAN/STATUS PART II " /tmp/stf91.tmp | /usr/bin/cut -c66-80)
echo ${FLE2} > /tmp/stf91-f2.tmp
echo "##FTP AFCOS DATA ########################################################"
/usr/bin/ftp -i -n 55.55.555.55 << !!
quote user michy
quote pass mouse
cd /afcos
put /webdata/comp/ordreg30.txt ordreg30.txt
put /webdata/comp/ordreg90.txt ordreg90.txt
put /comp/print/stanfins/$(cat /tmp/stf91-f1.tmp) finplan1.txt
put /comp/print/stanfins/$(cat /tmp/stf91-f2.tmp) finplan2.txt
bye
!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2006 02:10 AM
06-29-2006 02:10 AM
Re: FTP PROBLEM
HP ROCKS
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP