Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tar method does not prune old files #186

Closed
jack-mil opened this issue Jun 12, 2024 · 2 comments
Closed

tar method does not prune old files #186

jack-mil opened this issue Jun 12, 2024 · 2 comments

Comments

@jack-mil
Copy link

I am running with the backup now oneshot method, triggered by a cron job starting the docker container at specific times, as described in #156. However, pruning old files does not occur. I have to manually go in and remove old files every few days so I don't run out of space.
My world file is very large (18 GB uncompressed), so I am getting the "file changed as we read it" as decscribed in #56. Unsure if that is related or not. Backing up takes ~6 minutes.

Can anyone confirm if this is only any issue with one-shot backups? Does the container need to be long-running to delete old files correctly?

recent log:

2024-06-12T12:16:46-0400 INFO waiting for rcon readiness...
2024-06-12T12:16:46-0400 INFO Command executed successfully rcon-cli save-on
2024-06-12T12:16:46-0400 INFO Command executed successfully rcon-cli save-off
2024-06-12T12:16:50-0400 INFO Command executed successfully rcon-cli save-all flush
2024-06-12T12:16:50-0400 INFO Command executed successfully sync
2024-06-12T12:16:50-0400 INFO Backing up content in /data to /backups/world-20240612-121650.tar.zst
tar: world: file changed as we read it
2024-06-12T12:22:31-0400 WARN Dat files changed as we read it
2024-06-12T12:22:31-0400 INFO Command executed successfully rcon-cli save-on

dockercompose:

  backups:
    image: itzg/mc-backup
    environment:
      BACKUP_INTERVAL: "-1"
      RCON_HOST: mc
      RCON_PASSWORD: "<PASSWORD>"
      INITIAL_DELAY: "1h"
      PRUNE_BACKUP_DAYS: 4
      INCLUDES: world
      LINK_LATEST: true
      BACKUP_METHOD: "tar"
      TAR_COMPRESS_METHOD: "zstd"
      TZ: "America/New_York"
    depends_on:
      mc:
        condition: service_healthy
    volumes:
      # mount the same volume used by server, but read-only
      - ./data:/data:ro
      - /mnt/backups:/backups
      ```
@itzg
Copy link
Owner

itzg commented Jun 12, 2024

The "backup now" mode does include file pruning. The latest image now logs the info message about pruning every time since it was also confusing to me when I was testing. You can set the DEBUG env var to "true" to see exactly what it is doing during the prune step.

@jack-mil
Copy link
Author

Ok , thank you so much! That helped me identify that I was using the wrong environment variable PRUNE_BACKUP_DAYS instead of PRUNE_BACKUPS_DAYS. I also was able to trim my world quite a bit today, so the file size is much more managable, and backups take much less time. I think I never saw the script deleting old backps (I had it set to 4 days) because I would run out of disk space due to my large world size before it got to the default of 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants