Giter VIP home page Giter VIP logo

Comments (8)

johnsturgeon avatar johnsturgeon commented on July 17, 2024 1

I think I found the problem

7732c1635b36:/backups# ls -l
total 4
lrwxrwxrwx  1 1000 1000   21 Apr 15 15:18 latest -> world-20240415-151650
drwxrwxr-x 10 1000 1000 4096 Jan  9 19:47 world-20240415-151650
7732c1635b36:/backups# date
Tue Apr 16 07:00:49 PDT 2024

I think rsync is setting the timestamp of the folder to that of the original source.

the -a flag on rsync preserves timestamps, but if you touch the root folder after the backup but before the prune that should fix it.

from docker-mc-backup.

itzg avatar itzg commented on July 17, 2024 1

Glad to hear you found the issue and a fix. The github docs will give a nice overview of PR process. Basically you'll fork the repo, push your branch, and then submit a PR.

from docker-mc-backup.

itzg avatar itzg commented on July 17, 2024

Thanks for reporting this.

It looks like there might be a bug here

find "${DEST_DIR}" -maxdepth 1 -type d -mtime "+${PRUNE_BACKUPS_DAYS}" "${@}"

where -mtime expects units of hours, not days.

from docker-mc-backup.

itzg avatar itzg commented on July 17, 2024

Actually, find on Alpine accepts units of days for -mtime

	-mtime DAYS	mtime is greater than (+N), less than (-N),
			or exactly N days in the past

In that case I'm not sure why it is pruning a directory that is created on the same day.

from docker-mc-backup.

johnsturgeon avatar johnsturgeon commented on July 17, 2024

I'll play around a bit from inside the image, does seem odd though.

Are you able to reproduce it?

from docker-mc-backup.

johnsturgeon avatar johnsturgeon commented on July 17, 2024

I have created a local branch to fix the issue, and I tested it on my machine (works).

What's the process for submitting branches?
0001-Fixes-rsync-prune-issue-174.patch

from docker-mc-backup.

johnsturgeon avatar johnsturgeon commented on July 17, 2024

Glad to hear you found the issue and a fix. The github docs will give a nice overview of PR process. Basically you'll fork the repo, push your branch, and then submit a PR.

Will do!

from docker-mc-backup.

toddejohnson avatar toddejohnson commented on July 17, 2024

Just for reference -a is the same as -rlptgoD

       --recursive, -r          recurse into directories
       --links, -l              copy symlinks as symlinks
       --perms, -p              preserve permissions
       --times, -t              preserve modification times
       --group, -g              preserve group
       --owner, -o              preserve owner (super-user only)
       -D                       same as --devices --specials

Another option would be -rlpgoD which wouldn't preserve times. This might however null the benefit of --link-dest as the times of files would change causing them to not be "links." I think the touch is an awesome way to make this work!!!!

from docker-mc-backup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.