LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How can I run updatedb @reboot as a background process? (https://www.linuxquestions.org/questions/slackware-14/how-can-i-run-updatedb-%40reboot-as-a-background-process-524452/)

randomsel 01-31-2007 02:16 PM

How can I run updatedb @reboot as a background process?
 
How can I make uptadedb run as a background startup process?

If I add it to rc.local, it'll take a bit of time to finish running, and the boot-up process will be considerably longer.

I'd like to have something/someone else run it for me at startup, like cron, but slackware's crontab doesn't support @reboot like Vixie does (as said by THE MAN). Also, waiting for the daily cron job isn't an option because the machine gets turned off regularly (laptop, not server).

Thanks in advance

chess 01-31-2007 02:22 PM

Try:

updatedb &

in rc.local -- that will background the process. You may need to put in the full path to updatedb.

H_TeXMeX_H 01-31-2007 02:27 PM

I think you should still run it through cron.

But I think it's possible to background the process with

Code:

updatedb &
as long as it won't interfere with anything else.

Michielvw 02-02-2007 01:39 PM

updatedb runs daily already through cron

Code:

[root]:[/etc/cron.daily]# crontab -l | grep daily
# Run daily cron jobs at 4:40 every day:
40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
[root]:[/etc/cron.daily]#

and the in /etc/cron.dialy is the script slocate
Code:

[root]:[/etc/cron.daily]# cat slocate
#!/bin/sh
/usr/bin/updatedb -c /etc/updatedb.conf
[root]:[/etc/cron.daily]#


so unless there is a reason to run it from rc.local (for example if the box gets shutdown every night) there shouldn't be much reason to run it on boot as well.

chess 02-02-2007 03:36 PM

Quote:

Originally Posted by BlackPanther
so unless there is a reason to run it from rc.local (for example if the box gets shutdown every night) there shouldn't be much reason to run it on boot as well.

I think that's exactly the reason the OP gave: "Also, waiting for the daily cron job isn't an option because the machine gets turned off regularly (laptop, not server)."


All times are GMT -5. The time now is 03:49 AM.