Sync only existing directories (/ files)

Discuss new features and functions
Posts: 6
Joined: 26 Oct 2017

alagga

Hello,

Is it already possible so sync two parent directories and in these parent directories just sync the lowest existing subdirectories? Didnt found an option to do this and it would be a really useful feature.

(Another option then could also be to just sync existing files, but in my case thats not needed).

Let me explain why I'd need this:
Got a music library on my PC. On my Phone I dont have enough space to copy the whole library, so i can just sync some of the music. But when change e.g.ID3 Tags on my Phone i want to automatically sync these new files with the music library

(I know I could just put in every sub directory, but this is no option as there are way too much subdirectories in my music library)

Thanks in advance and best greets.
Posts: 6
Joined: 26 Oct 2017

alagga

I hope it's allowed to push. Would be really nice to get this
Posts: 1
Joined: 6 Jan 2018

Ewe_Loon

I agree , A filter to Sync only if both file exist would be usefill, I also need a Filter to Sync if only one file exists
so filters need to be able to be tagged with a "only if both files exist" flag
User avatar
Posts: 2280
Joined: 22 Aug 2012

Plerry

Did you try defining a Custom sync method (instead of using Mirror, Update or Two-way?)

If you used to use Mirror or Update, try:
For the Category "Item exists on left side only", select "Do nothing" instead of "Copy new item to right"

If you used to use Two-way, try:
For the Category "Item exists on left side only", select "Do nothing" instead of "Copy new item to right"
For the Category "Item exists on right side only", select "Do nothing" instead of "Copy new item to left"
Posts: 6
Joined: 26 Oct 2017

alagga

Did you try defining a Custom sync method (instead of using Mirror, Update or Two-way?)

If you used to use Mirror or Update, try:
For the Category "Item exists on left side only", select "Do nothing" instead of "Copy new item to right"

If you used to use Two-way, try:
For the Category "Item exists on left side only", select "Do nothing" instead of "Copy new item to right"
For the Category "Item exists on right side only", select "Do nothing" instead of "Copy new item to left" Plerry, 15 Jan 2018, 14:36
Thanks for the Nice Idea.
But this just works partially: If you rename a File you break the synchronisation.

But for music i think i can live with this disadvantage, as you mostly don't have to edit filename (rather edit ID3 Tags).
Edit: And you also don't have the option to sync the newer file (when it exists on both sides). You can just choose to copy file from left or from right.
Posts: 6
Joined: 22 Feb 2018

Linus

I am looking for a solution to quite the same problem.

I have a directory "photos" with subdirectories for each month "photos/2017-01", "photos/2017-02", and so on.

On my external hard drive I archive it all.
On my laptop I only have the most recent directories.

Two things can happen:
- I have a new month directory on my laptop that is not yet copied to the external drive.
- I purposefully removed files in a month directory on my laptop that already exists on the external drive.

Now I would like sync to make a "mirror" from my laptop to the external drive, but only for the month directories that are present on the laptop.

If I do "mirror" now, it wants to delete all the month directories on my external disk which are not on the laptop. (not good!)

If I do "update", it does not remove the purposefully removed files on the external disk.

Any ideas?
It would be great, if I could define a filter saying instead of "Include: *" something like "Include: .\*"; meaning that I only want all items in .\ to be synced but not . itself. Then I could do the "mirror".
User avatar
Posts: 2280
Joined: 22 Aug 2012

Plerry

@ Linus
Did you consider to use the time-span function in the filter/funnel (F7) window.
That might bring you already very close to where you want to be.

About your suggested filter definition .\* :
Please note that in filter definitions the dot "." is just that and does e.g. not refer to the present directory.
If you want to include only files in subdirectories of the left- and right base location,
but not the files in the root of the base location, try replacing your include filter
definition * by \*\*.
See the manual page on excluding (and including) items.
Posts: 6
Joined: 22 Feb 2018

Linus

Hey Plerry, thanks a lot for the quick reply.
I just got around to trying your suggestions today.

\*\* did not have any effect apparatently.
But the time-span has exactly the effect I was aiming for!
Thanks a lot!
User avatar
Posts: 2280
Joined: 22 Aug 2012

Plerry

... \*\* did not have any effect apparatently. ...Linus, 12 Mar 2018, 03:15
That is remarkable! Did you replace the include definition * by \*\* , or did you just add \*\* ?
In the latter case it is obvious it has no effect, as you then already include everything via * .

But, I just verified that when you replace * by \*\* in the include filter definition,
all files in subfolders of the left- and right-base location are included in the sync,
but not the files in the root of the left- and right base location.
Posts: 6
Joined: 22 Feb 2018

Linus

You are probably right that the files in the root are not included any more when using \*\* instead of just *.

What I would have wanted was that also the directories in the root are not included any more, while the content of these directories is still regarded. Thus, only the content of the left-side directories should be mirrored to the right-side.
User avatar
Posts: 2280
Joined: 22 Aug 2012

Plerry

By using the include definition \*\* you actually only include files in subdirectories,
not directly the subdirectories themselves.
As FFS retains the directory-structure when syncing files, it will also sync the directory structure of the files being synced. However, it will not include any empty directories or branches containing only empty directories.
Thus, only the content of the left-side directories should be mirrored to the right-side.
This reads like you would actually like the files in left-side subfolders to be synced to the (root of) the right-side base folder.
However, that is not the way FFS runs syncs, as FFS retains the directory structure.
Posts: 6
Joined: 22 Feb 2018

Linus

Thanks again for your reply!

As I said, you already solved my problem with the hint regarding the time-span filter.
But to make again clear what I meant initially, consider the following example:
left-side-base-folder
    folder1
        file1.1
    folder3
       file3.1
right-side-base-folder
    folder1
        file1.1
        file1.2
    folder2
        file2.1

I would need a sync option that results in left-side-base-folder unchanged and
right-side-base-folder
    folder1
        file1.1
    folder2
        file2.1
    folder3
       file3.1

or at least
right-side-base-folder
    folder1
        file1.1
    folder2
        file2.1


But the only thing I can come up with (Mirror --> with either filter * or \*\*) naturally results in
right-side-base-folder
    folder1
        file1.1
    folder3
       file3.1
User avatar
Posts: 2280
Joined: 22 Aug 2012

Plerry

When using the Mirror sync variant, after the sync you will have a duplicate of all (included and not excluded) files and folders of your left location in your right location.
All other (included and not excluded) files that pre-existed in the right location will be deleted there.

If you want to retain any (included and not excluded) files/folders that pre-exist in the right location and would get deleted from the right location when running a Mirror-sync, you should be using the Update sync variant instead of the Mirror variant.
Posts: 6
Joined: 22 Feb 2018

Linus

Yes, I understand.

But with "update" I will end up with
right-side-base-folder
    folder1
        file1.1
        file1.2
    folder2
        file2.1
    folder3
        file3.1
I.e. the files I removed within folders on the left side won't be deleted on the right side.

So I guess what I want is "update of all directories in the root", but for the content of each of these directories I would like a sync. :-)
Posts: 2
Joined: 4 Sep 2021

tageloehner

Yes, I understand.

But with "update" I will end up with
right-side-base-folder
    folder1
        file1.1
        file1.2
    folder2
        file2.1
    folder3
        file3.1
I.e. the files I removed within folders on the left side won't be deleted on the right side.

So I guess what I want is "update of all directories in the root", but for the content of each of these directories I would like a sync. :-) Linus, 15 Mar 2018, 07:46
How about you first somehow create a list of all the folders on your notebook and then post said list in the "include filter" of ffs?
I was thinking maybe with command line "ls" or a third party program?
Posts: 6
Joined: 22 Feb 2018

Linus

Wow, a reply after 3,5 years! :-D Thank you very much for your suggestion.
I might give this a go!