Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to download a file from an external location eg and then save that file to /etc/config.xml when the server starts.

What is the best way to do this in fedora?

I assume I need some boot script as this need to be done every restart/start.

Just to clarify, the process will be:

  • Server boots up
  • Server downloads file from the location
  • Server runs command "serivce httpd start"
share|improve this question
up vote 2 down vote accepted

you can use cron's @reboot directive to run a script every time your system starts up. edit /etc/crontab

@reboot root cd /to/where/xml/file/lives && /usr/bin/wget -q && /sbin/service http start

As per IgnacioVazquez-Abrams comment you will need to disable httpd at startup using the chkconfig command e.g.

chkconfig httpd off

share|improve this answer
crond starts after httpd in Fedora. – Ignacio Vazquez-Abrams Apr 5 '11 at 11:53
@IgnacioVazquez-Abrams: this does what the OP asked for. I kind of assumed that the OP had used chkconfig to disable httpd at startup. – Iain Apr 5 '11 at 11:55

You can just put the commands into /etc/rc.local. This script is ran at the end of the boot process, so your network interfaces and settings will have been initiated. You may have to disable the existing httpd startup script (which is probably in /etc/init.d), by making it non executable:

sudo chmod -x httpd

Or simply by moving it to another location.

More information on the boot sequence can be found at:

It may not be specific to your distro, but the process is usually pretty similar on any modern distro.

share|improve this answer
Except that you need not jump through such hoops in Fedora; a single chkconfig command will disable it. – Ignacio Vazquez-Abrams Apr 5 '11 at 11:42
Ah yes, good point. – James Little Apr 5 '11 at 11:54

Write an initscript that runs in between network/NetworkManager and httpd. See /usr/share/doc/initscripts-*/sysvinitfiles for more details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.