This article is the third in the "Mix Space + Yohaku Deployment Series" and shows how to use 1Panel scheduled tasks to automate blog updates. The core idea is to store two commands in the script library: switch to the Compose directory, run docker compose pull to fetch the latest images, then use up -d to rebuild containers. The process has three steps: first create an update script in the script library (via the panel or command-line import), then create a scheduled task with a Cron expression (3 AM daily is recommended), and finally run it manually to verify. The article also answers common questions: unchanged containers are normal, ghcr.io requires prior login and a PAT with read:packages permission, backend updates should precede frontend, downtime lasts only seconds, and failures can be diagnosed via logs. In the end, one script plus one scheduled task keeps the blog automatically up to date, cutting manual maintenance overhead.
Note
This is the third post in the “Mix Space + Yohaku Deployment Series,” focused on configuring automatic updates. It's recommended to finish the deployments from the first two posts before reading on.
Once your blog is up and running, the real operations work is just beginning.
The Yohaku frontend keeps iterating, the Core backend keeps patching vulnerabilities, and the images it depends on keep getting updated. If you log in to the server to pull and restart manually every time, it's not just tedious—it's easy to forget, until one day you notice the blog is still running last month's old version and suddenly remember it's time to update.
This post shows you how to turn updates into an automated process with 1Panel's scheduled tasks. Once configured, the server will automatically check for and pull the latest images on your schedule, keeping the blog system fresh—and you don't have to lift a finger.
Note
When this guide applies:
· Both the Core backend and the Yohaku frontend are deployed as local apps in 1Panel
· The frontend image comes from the ghcr.io private registry (or the official innei/shiro:latest)
· You want to keep the system up to date with minimal manual effort
The Core Idea
1Panel's scheduled task feature can run custom scripts on a schedule. All you need to write is two commands:
BASH
cd /opt/1panel/apps/local/mxspace/mxspace && docker compose pull && docker compose up -d
cd /opt/1panel/apps/local/yohaku/yohaku && docker compose pull && docker compose up -d
Let's break them down one by one:
Command snippet Purpose
cd ... Switch to the app's Compose directory
docker compose pull Pull the latest images (without restarting)
docker compose up -d Rebuild and start containers from the new images
The two commands cover the backend and frontend respectively. When the scheduled task fires, 1Panel runs them in sequence, updating frontend and backend together in one smooth sweep.
Step 1 · Create a Script Library
1Panel's “Script Library” feature can store commonly used script snippets for scheduled tasks or manual invocation. We'll save the update script there, so you can reference it from a scheduled task later or run it manually anytime.
Option 1 · Create via the 1Panel Dashboard (Recommended)
In the sidebar, go to Scheduled Tasks → Script Library, then click Create in the top-right corner:
Field Value
Name Auto-Update Blog (customizable)
Script Content See the code block below
Fill in the following script:
BASH
#!/bin/bash
echo "$(date '+%Y-%m-%d %H:%M:%S') - 开始更新 Mix Space 后端..."
cd /opt/1panel/apps/local/mxspace/mxspace
if docker compose pull && docker compose up -d; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - 后端更新成功"
else
echo "$(date '+%Y-%m-%d %H:%M:%S') - 后端更新失败,请检查日志"
exit 1
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') - 开始更新 Yohaku 前端..."
cd /opt/1panel/apps/local/yohaku/yohaku
if docker compose pull && docker compose up -d; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - 前端更新成功"
else
echo "$(date '+%Y-%m-%d %H:%M:%S') - 前端更新失败,请检查日志"
exit 1
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') - 全部更新完成 🎉"
Click Confirm to save. The script library is now ready.
Option 2 · Write It Quickly from the Command Line
If you're comfortable with SSH, you can create the script file directly on the server:
BASH
sudo tee /opt/1panel/scripts/自动更新博客.sh > /dev/null << 'EOF'
#!/bin/bash
echo "$(date '+%Y-%m-%d %H:%M:%S') - 开始更新 Mix Space 后端..."
cd /opt/1panel/apps/local/mxspace/mxspace
if docker compose pull && docker compose up -d; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - 后端更新成功"
else
echo "$(date '+%Y-%m-%d %H:%M:%S') - 后端更新失败,请检查日志"
exit 1
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') - 开始更新 Yohaku 前端..."
cd /opt/1panel/apps/local/yohaku/yohaku
if docker compose pull && docker compose up -d; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - 前端更新成功"
else
echo "$(date '+%Y-%m-%d %H:%M:%S') - 前端更新失败,请检查日志"
exit 1
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') - 全部更新完成 🎉"
EOF
chmod +x /opt/1panel/scripts/自动更新博客.sh
Then, in the 1Panel Script Library, choose “Import from File.” When importing, navigate to the directory where the script file lives, /opt/1panel/scripts/. If that path doesn't match your installation, check where the file is actually stored on the server before importing.
Step 2 · Create a Scheduled Task
With the script in place, let's set up the execution schedule.
In the sidebar, go to Scheduled Tasks → Scheduled Tasks, then click Create in the top-right corner:
Field Value
Task Name Auto-Update Blog (customizable)
Execution Cycle Custom Cron expression
Script Content Choose “Script Library” and select the Auto-Update Blog script from the previous step
Execution Timeout Keep the default (10 minutes)
Notify on Error Optional; recommended to enable
How Should You Set the Execution Cycle?
The author recommends once a day, run during the early morning when server load is lowest. In a Cron expression, that looks like:
CRON
0 3 * * *
This means it runs at 3:00 AM every day. You can adjust it to suit your needs:
Frequency Cron expression Description
Once a day 0 3 * * * Recommended: early-morning off-peak
Every 6 hours 0 */6 * * * More frequent updates; good for actively iterating projects
Once a week 0 3 * * 0 Sunday early morning
Manual trigger Leave blank, then click the “Execute” button later
No automatic execution; update manually only when needed
A Small Detail About How 1Panel Runs Scheduled Tasks
After a scheduled task is created, 1Panel runs it at the corresponding time in the server's time zone by default. If your server's time zone isn't Asia/Shanghai, it's worth checking:
BASH
timedatectl
If the time zone is wrong, switch it to Beijing time:
BASH
sudo timedatectl set-timezone Asia/Shanghai
Step 3 · Verify and Run Manually
Once the scheduled task is created, there are two ways to verify it works properly.
Option 1 · Run Manually
In the scheduled task list, find the task you just created and click the Execute button on the right. 1Panel will run the script immediately; refresh the page a few seconds later and check the output log under “Execution Records.”
If you see output like this, it means everything worked:
If you set it for 3 AM every day, just check the execution records the next morning. If the script fails, 1Panel logs the error, and you can find the specific cause in the execution records.
FAQ
Q: After the update the container didn't change. Did the script fail?
Not necessarily. docker compose pull checks whether a newer version of the image exists. If there's no update, up -d won't rebuild the container, and its status will show as up-to-date. That's normal behavior—no need to worry.
Q: Pull fails when using ghcr.io private images?
Scheduled tasks run in the server's Docker environment, so make sure you've logged in with docker login ghcr.io. 1Panel's container registry credentials are independent of Docker login, so it's recommended to run it manually on the server once:
BASH
docker login ghcr.io -u 你的GitHub用户名 -p 你的PAT
Note: The Personal Access Token (PAT) used to pull ghcr.io images needs read:packages permission, otherwise you'll get an “unauthorized” error after logging in. You can create or modify it under GitHub → Settings → Developer settings → Personal access tokens.
Q: Is there a dependency order between backend and frontend updates?
Backend updates usually don't break frontend compatibility, but to be safe, updating the backend first and then the frontend is the more robust order. The script already follows this order.
Q: Will the blog be unavailable during updates?
docker compose up -d rebuilds and starts the containers, so downtime is extremely short (a few seconds to about ten). If your blog gets heavy traffic, consider running it during early-morning off-peak hours.
Q: How do I troubleshoot a failed script execution?
Check the full log in the execution records of the 1Panel scheduled task
Log into the server and run the script manually to observe the exact error
Check that the /opt/1panel/apps/local/mxspace/mxspace and /opt/1panel/apps/local/yohaku/yohaku directories contain a docker-compose.yml file
Check whether the Docker service is running normally: docker ps
Q: Can I update only the backend or only the frontend?
Yes. Just delete the corresponding section from the script. To update only the backend, keep the first section (cd ... mxspace) and remove the second (cd ... yohaku).
Summary
One script + one scheduled task = a Mix Space blog that stays up to date automatically.
Let's recap the whole process:
Create a script library: save the update commands as a reusable script
Create a scheduled task: set the execution cycle and link the script library
Verify execution: trigger it once manually and confirm the logs look good
From then on, leave everything to 1Panel. It will quietly pull the latest images and restart containers in the background on your schedule, keeping the blog always current. All you need to focus on is one thing—writing the next post that deserves to be savored.
The essence of operations is keeping a system running in good order even when nobody's watching.
This is the third post in the “Mix Space + Yohaku Deployment Series,” focused on configuring automatic updates. It's recommended to finish the deployments from the first two posts before reading on.
Once your blog is up and running, the real operations work is just beginning.
The Yohaku frontend keeps iterating, the Core backend keeps patching vulnerabilities, and the images it depends on keep getting updated. If you log in to the server to pull and restart manually every time, it's not just tedious—it's easy to forget, until one day you notice the blog is still running last month's old version and suddenly remember it's time to update.
This post shows you how to turn updates into an automated process with 1Panel's scheduled tasks. Once configured, the server will automatically check for and pull the latest images on your schedule, keeping the blog system fresh—and you don't have to lift a finger.
When this guide applies: · Both the Core backend and the Yohaku frontend are deployed as local apps in 1Panel · The frontend image comes from the ghcr.io private registry (or the official innei/shiro:latest) · You want to keep the system up to date with minimal manual effort
The Core Idea
1Panel's scheduled task feature can run custom scripts on a schedule. All you need to write is two commands:
Let's break them down one by one:
Command snippet Purpose cd ... Switch to the app's Compose directory docker compose pull Pull the latest images (without restarting) docker compose up -d Rebuild and start containers from the new images
The two commands cover the backend and frontend respectively. When the scheduled task fires, 1Panel runs them in sequence, updating frontend and backend together in one smooth sweep.
Step 1 · Create a Script Library
1Panel's “Script Library” feature can store commonly used script snippets for scheduled tasks or manual invocation. We'll save the update script there, so you can reference it from a scheduled task later or run it manually anytime.
Option 1 · Create via the 1Panel Dashboard (Recommended)
In the sidebar, go to Scheduled Tasks → Script Library, then click Create in the top-right corner:
Field Value Name Auto-Update Blog (customizable) Script Content See the code block below
Fill in the following script:
Click Confirm to save. The script library is now ready.
Option 2 · Write It Quickly from the Command Line
If you're comfortable with SSH, you can create the script file directly on the server:
Then, in the 1Panel Script Library, choose “Import from File.” When importing, navigate to the directory where the script file lives, /opt/1panel/scripts/. If that path doesn't match your installation, check where the file is actually stored on the server before importing.
Step 2 · Create a Scheduled Task
With the script in place, let's set up the execution schedule.
In the sidebar, go to Scheduled Tasks → Scheduled Tasks, then click Create in the top-right corner:
Field Value Task Name Auto-Update Blog (customizable) Execution Cycle Custom Cron expression Script Content Choose “Script Library” and select the Auto-Update Blog script from the previous step Execution Timeout Keep the default (10 minutes) Notify on Error Optional; recommended to enable
How Should You Set the Execution Cycle?
The author recommends once a day, run during the early morning when server load is lowest. In a Cron expression, that looks like:
This means it runs at 3:00 AM every day. You can adjust it to suit your needs:
Frequency Cron expression Description Once a day 0 3 * * * Recommended: early-morning off-peak Every 6 hours 0 */6 * * * More frequent updates; good for actively iterating projects Once a week 0 3 * * 0 Sunday early morning Manual trigger Leave blank, then click the “Execute” button later No automatic execution; update manually only when needed
A Small Detail About How 1Panel Runs Scheduled Tasks
After a scheduled task is created, 1Panel runs it at the corresponding time in the server's time zone by default. If your server's time zone isn't Asia/Shanghai, it's worth checking:
If the time zone is wrong, switch it to Beijing time:
Step 3 · Verify and Run Manually
Once the scheduled task is created, there are two ways to verify it works properly.
Option 1 · Run Manually
In the scheduled task list, find the task you just created and click the Execute button on the right. 1Panel will run the script immediately; refresh the page a few seconds later and check the output log under “Execution Records.”
If you see output like this, it means everything worked:
Option 2 · Wait for the Automatic Trigger
If you set it for 3 AM every day, just check the execution records the next morning. If the script fails, 1Panel logs the error, and you can find the specific cause in the execution records.
FAQ
Q: After the update the container didn't change. Did the script fail?
Not necessarily. docker compose pull checks whether a newer version of the image exists. If there's no update, up -d won't rebuild the container, and its status will show as up-to-date. That's normal behavior—no need to worry.
Q: Pull fails when using ghcr.io private images?
Scheduled tasks run in the server's Docker environment, so make sure you've logged in with docker login ghcr.io. 1Panel's container registry credentials are independent of Docker login, so it's recommended to run it manually on the server once:
Note: The Personal Access Token (PAT) used to pull ghcr.io images needs read:packages permission, otherwise you'll get an “unauthorized” error after logging in. You can create or modify it under GitHub → Settings → Developer settings → Personal access tokens.
Q: Is there a dependency order between backend and frontend updates?
Backend updates usually don't break frontend compatibility, but to be safe, updating the backend first and then the frontend is the more robust order. The script already follows this order.
Q: Will the blog be unavailable during updates?
docker compose up -d rebuilds and starts the containers, so downtime is extremely short (a few seconds to about ten). If your blog gets heavy traffic, consider running it during early-morning off-peak hours.
Q: How do I troubleshoot a failed script execution?
Q: Can I update only the backend or only the frontend?
Yes. Just delete the corresponding section from the script. To update only the backend, keep the first section (cd ... mxspace) and remove the second (cd ... yohaku).
Summary
One script + one scheduled task = a Mix Space blog that stays up to date automatically.
Let's recap the whole process:
From then on, leave everything to 1Panel. It will quietly pull the latest images and restart containers in the background on your schedule, keeping the blog always current. All you need to focus on is one thing—writing the next post that deserves to be savored.
The essence of operations is keeping a system running in good order even when nobody's watching.
References
· 1Panel scheduled task documentation · Docker Compose CLI reference · Cron expression generator
The secret to staying ever-fresh is persistence. May your blog, through these silent updates, grow a little more each day 🌿