The 'feature' has been available since
v2.02?, but most aren't obsessed/fixated with cache....hence no auto-schedule
Ensure you are running in
Advanced Menu mode; then check that auto-restore
@boot is ENABLED
Code:
e = Exit Script [?]
A:Option ==> dumpcache bootrest
07:56:55 Saving unbound cache to '/opt/share/unbound/configs/cache.txt' msg.cache=8006/356 rrset.cache=14122/1639
NOTE: unbound cache will be automatically RESTORED on REBOOT (see /jffs/scripts/post-mount)
'/jffs/scripts/post-mount'
Code:
# If unbound UP, reload the cache if file is less than 10 mins old - requires Entware's '/opt/bin/find'
FN="/opt/share/unbound/configs/cache.txt";if [ -n "$(pidof unbound)" ] && [ -s $FN ] && [ -n "$(/opt/bin/find $FN -type f -mmin -10)" ];then TIMESTAMP=$(date -r $FN "+%Y-%m-%d %H:%M:%S");unbound-control load_cache < $FN; rm $FN; logger -st "($(basename $0))" "unbound cache RESTORED from '$FN'" $TIMESTAMP;fi # unbound_manager
Now
manually schedule the cache save (obviously you should really check to see if unbound is
UP before attempting the save!)
Code:
cru a unbound_cache "*/1 * * * *" "unbound-control dump_cache > /opt/share/unbound/configs/cache.txt"
Code:
cru l
*/1 * * * * unbound-control dump_cache > /opt/share/unbound/configs/cache.txt #unbound_cache#
Check
cron
is dumping the cache to the file on schedule ...
Code:
watch ls -l /opt/share/unbound/configs/cache.txt