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?
@daily /usr/bin/updatedb
Should work. I suspect you didn't actually create the crontab entry ?
Did you see this ?
/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?)
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.
#!/bin/bash
/usr/bin/updatedb
I did create crontab, but as root, so if I didn't login as root it had no effect? And thanks for answer!
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 ?