file selection behavior

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

file selection behavior

duplicity-talk mailing list
Hi,

I have a file selection question.

Suppose I have a directory in which most of the files in change rarely,
but one changes daily.  A simple example would look like the following:


/top/sub/rarelychanges1.txt

/top/sub/rarelychanges2.txt

/top/sub/rarelychanges3.txt

/top/sub/changesdaily.txt


I would like to back up all the files in /top/sub except
changesdaily.txt so I create a filelist with rules that look like:


-/top/sub/changesdaily.txt
+/top/sub


This criteria works as intended, but has one unexpected behavior.
Because the modification time property on the directory /top/sub changes
whenever the file /top/sub/changesdialy.txt changes, every incremental
snapshot I make includes an entry for /top/sub to capture the directory
property change.

I understand why one would want this behavior in general, but I do not
care about the modification time change and would like to avoid
including this in the snapshot.  On my system, this would prevent the
creation of excessive (daily) "duplicity-new-signatures.*.sigtar.gz"
files that do not contain content changes I care about.

Is there any way to do this?

Thanks,

Jordan




_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: file selection behavior

duplicity-talk mailing list
On 10/13/2018 21:44, Jordan Rosenthal via Duplicity-talk wrote:

> Hi,
>
> I have a file selection question.
>
> Suppose I have a directory in which most of the files in change rarely, but one changes daily.  A simple example would look like the following:
>
>
> /top/sub/rarelychanges1.txt
>
> /top/sub/rarelychanges2.txt
>
> /top/sub/rarelychanges3.txt
>
> /top/sub/changesdaily.txt
>
>
> I would like to back up all the files in /top/sub except changesdaily.txt so I create a filelist with rules that look like:
>
>
> -/top/sub/changesdaily.txt
> +/top/sub
>
>
> This criteria works as intended, but has one unexpected behavior. Because the modification time property on the directory /top/sub changes whenever the file /top/sub/changesdialy.txt changes, every incremental snapshot I make includes an entry for /top/sub to capture the directory property change.
>
> I understand why one would want this behavior in general, but I do not care about the modification time change and would like to avoid including this in the snapshot.  On my system, this would prevent the creation of excessive (daily) "duplicity-new-signatures.*.sigtar.gz" files that do not contain content changes I care about.
>
> Is there any way to do this?

hey Jordan,

tl;dr - no.

that's because the mod time of a folder is not the mod time of the last modified file in it. see
  https://stackoverflow.com/questions/3620684/directory-last-modified-date
or
  https://superuser.com/questions/1039003/linux-how-does-file-modification-time-affect-directory-modification-time-and-di
.

so either your fs implementation is somewhat special or whatever writes files there does not simply change them but overwrites them instead.

as a workaround you could be set the folder mod time manually to a fixed value, duplicity should traverse it anyway, but i am not sure that this would be advisable.

..ede/duply.net

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
Reply | Threaded
Open this post in threaded view
|

Re: file selection behavior

duplicity-talk mailing list
In reply to this post by duplicity-talk mailing list
On Sat, 13 Oct 2018 15:44:08 -0400
Jordan Rosenthal via Duplicity-talk <[hidden email]> wrote:

> Because the modification time property on the directory /top/sub changes
> whenever the file /top/sub/changesdialy.txt changes, every incremental
> snapshot I make includes an entry for /top/sub to capture the directory
> property change.

If changesdaily.txt is created with a shell script, then one way of
avoiding the mtime change on the directory is by generating
changesdaily.txt outside the directory and cp'ing it into the directory.

Since cp uses open(2), write(2) and close(2), the inode number of
changesdaily.txt in the directory does not change, so the mtime of the
directory does not change.

If you were to use mv instead, the directory's mtime is updated because
mv is implemented using rename(2) which requires updating the
directory to have a new inode number for changesdaily.txt.

Mathias

_______________________________________________
Duplicity-talk mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk