Auto Update Downloaded Ollama Models

Search for a command to run...

No comments yet. Be the first to comment.
Most AI agents that support scheduled tasks have two sources of instruction when a cron job fires: The cron prompt — the task-specific instructions you wrote when scheduling the job The skill — a re

TL;DR Scarp draw result, host on GitHub, retrieve it like API at damacai.hongineer.com. Data Scraping I have previously shared a technique for scraping Da Ma Cai draw result. Now I finally have time t

This is a Bash script that check if the replica (slave) health status. If there is an issue, it will exist with non-zero status. This is useful when used with monitoring tools like [Monit](https://mmo

chmod is a command-line utility used to change the access permissions of file system objects such as files and directories. It allows you to control who can read, write, and execute those objects. Changing Permissions Using Octal Notation Example Usa...
chown changes the ownership of files and directories. This involves modifying the user and/or group associated with a file, determining who has access and permissions. Changing File Ownership to a Specific User Example Usage: chown user file.txt What...
I like to keep all models updated, but Ollama does not automatically update downloaded models. This is how I automate updates using a cronjob and Bash script.
~/.local/bin/update-models.sh
#!/usr/bin/env bash
# Update all local models.
models=$(ollama ls | tail -n +2 | awk '{print $1}')
for model in $models
do
echo "Pulling ${model}"
ollama pull $model
done
Run it after 12 AM daily. I introduced delay execution in this blog post.
0 0 * * * sleep $((RANDOM % 3600)); ~/.local/bin/update-models.sh > /dev/null 2>&1