This document explains how to enable the automated daily update for the ipfs-kit-mcp service.
Files added to the repository:
scripts/auto_update_and_restart.sh— script that pullsmain, installs requirements, installs package in editable mode, and restarts the service. Logs tologs/auto_update.log.cron/ipfs-kit-update.cron— sample/etc/cron.dfile to run the script daily at 04:20.ipfs-kit-mcp.service— updated in-place to useRestart=alwaysand a few safety options.
Quick install steps (run as root):
- Copy the cron file to
/etc/cron.d:
cp /home/barberb/ipfs_kit_py/cron/ipfs-kit-update.cron /etc/cron.d/ipfs-kit-update
chmod 644 /etc/cron.d/ipfs-kit-update- Make the script executable and ensure ownership for
barberb:
chown barberb:barberb /home/barberb/ipfs_kit_py/scripts/auto_update_and_restart.sh
chmod +x /home/barberb/ipfs_kit_py/scripts/auto_update_and_restart.sh-
(Optional) Review the cron file's PATH and SHELL. The cron file runs the job as user
barberb. -
Reload systemd to pick up any service file changes and restart the service now (run as root):
systemctl daemon-reload
systemctl restart ipfs-kit-mcp.service
systemctl status ipfs-kit-mcp.service --no-pagerNotes and safety:
- The script performs a
git pull --ff-only. If the remote has diverged (needs merge), the job will stop and log the issue instead of performing a merge. - The script uses the Python at
/home/barberb/miniforge3/bin/pythonandpipvia that python. Adjust thePYTHONvariable in the script if your runtime differs. - The cron file provided should be copied to
/etc/cron.dby an administrator. The repository copy is only for source control and review. - Because these operations modify code and install packages automatically, ensure you trust the
mainbranch contents and backups are in place.