[Solved] Upload file to FTP Server in %post
Chun Tat David Chu
beyonddc.storage at gmail.com
Tue Aug 9 21:50:46 UTC 2011
The below code does work when you add the following right before the FTP
upload
HOME=/root
ftp locates .netrc from ${HOME} so ${HOME} must be set.
I am assuming that ${HOME} is not set while Anaconda is running.
- dc
On Tue, Aug 9, 2011 at 5:28 PM, Chun Tat David Chu <
beyonddc.storage at gmail.com> wrote:
> Hi All,
>
> I am using RHEL 5.2 and within my %post, I would like to upload a file to
> an anonymous enabled FTP server.
>
> Here's what I am doing.
>
> %post
> cat <<NETRC > /root/.netrc
> machine <SERVER_IP>
> login anonymous
> password ^M
> NETRC
>
> ftp -i <SERVER_IP> <<EOF
> put /root/${TAR_FILE_NAME}.gpg
> system_to_rebuild/<HOSTNAME>/${TAR_FILE_NAME}.gpg
> quit
> EOF
>
> I am not sure what went wrong here. When I run this scriptlet standalone
> in a shell, it runs successfully.
> However when run within Anaconda, it doesn't work. I couldn't see the file
> being uploaded to my FTP server.
>
> Any idea?
>
> Thanks,
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20110809/b9962f52/attachment.htm>
More information about the Kickstart-list
mailing list