Skip to main content
Topic: updatedb cron jon (Read 387 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

updatedb cron jon

I've recently installed plocate, which ships updatedb command to update database and I want to run it daily. How can I achieve it with cronie? Somewhere on internet I found, that running sudo crontab -e and typing @daily /usr/bin/updatedb would work, but it didn't work for me. So should I put some shell script in /etc/cron.daily? And if so, how should it look?

Re: updatedb cron jon

Reply #1
Code: [Select]
@daily /usr/bin/updatedb
Should work. I suspect you didn't actually create the crontab entry ?
Did you see this ?
Code: [Select]
/bin/sh: line 1: /usr/bin/vi: No such file or directory
If so this should work (if nano is installed which I think it is by default?)
Code: [Select]
su
EDITOR=nano crontab -e
If you want to do it in cron.daily instead create a file in that directory, make it executable and put this it.
Code: [Select]
#!/bin/bash
/usr/bin/updatedb

Re: updatedb cron jon

Reply #2
I did create crontab, but as root, so if I didn't login as root it had no effect? And thanks for answer!

Re: updatedb cron jon

Reply #3
I'm not fully understanding you. You don't have to be logged in for root (or user) cron jobs to run.
Is it working now ?