4

I am on Pixel 3 XL. I found that Google Photos recognizes the Facebook photo folder (and some others, such as Screenshots) the same as the "Camera" folder because they are within the DCIM folder. Therefore, we cannot tell Google Photos not to backup these folder within Google Photos settings.

The only option I have come across is to put a .nomedia file in the Facebook folder. That does prevent Google Photos from backing it up, but it also prevent me from seeing that folder in any other app. As you know, the Pixel does not include a traditional photo gallery, as they want you to use the google photos app so I use a photo gallery app from the play store. Either way with the .nomedia file in that folder I cannot see the images in that folder anywhere.

Is there any other way to stop Google Photos from backing up this folder without making the images invisible on my device? Google photos should not be treating all folders within DCIM as "Camera" and instead it should be looking specifically for the camera roll folder.

Related post: Change Facebook (and others) photo saving folder

2 Answers 2

3

You're not restricted by Google to use only Photos app as a Gallery app, so why not try a third-party app? I remembered that I used to use Piktures and QuickPic app and both of them (paid feature in Piktures), as I tested now, provides an option to show hidden or .nomedia file containing folders inside their settings. I'm sure some other gallery apps might be having a similar feature.

0

Use my beginner friendly Tasker project which I made based on this answer. I made some significant improvements that allow it to be used for many other scenarios beyond just moving Facebook's images, and included multiple examples within the project to learn from:

  1. While the original version could detect if the file being moved already existed in the destination directory, it could only handle one iteration of the conflict. For example, if example.jpg were being moved, but it already existed, it would rename the file being moved to example(1).jpg. However, if example.jpg were being moved and both example.jpg and example(1).jpg already existed, it would simply overwrite example(1).jpg.
    • My version will run an iterative check on names which increments the suffix variable until a non-existing name is found. For example, if example.jpg is taken, it will check example(2).jpg. If that is taken, it will check example(3).jpg, and so on until an available name is found. It also correctly appends the first duplicate with (2) rather than (1).
  2. The original version assumed the first "." in a file name was also the last "." before the extension. While this is fine for images from Facebook, it's not an ideal assumption, and breaks down when adopting the task for other uses, such as moving APKs. With the original, if com.example.app.apk already existed in the destination directory, trying to move a second copy of it would result in com(1).example.app.apk.
    • In addition to fixing the suffix and making it iterative, I've also changed the logic for its placement, such that it will always go before the last ".". In the above example, the apk would now be renamed to com.example.app(2).apk. This doesn't always work perfectly (consider .tar.gz and other similar cases for instance), but it does a good enough job without having to hard-code in every possible extension.
  3. This appears to vary from device to device, but on my devices, the original version would leave behind broken references to images in gallery apps and other programs that utilize the media provider (most messaging apps that have an image selection UI) due to not correctly refreshing this data. This was not an issue for moving images out of a directory containing a .nomedia file, but caused issues if you wanted to use it in a directory where you didn't want or couldn't have a .nomedia file (such as automatically moving downloaded images out of /sdcard/Download/).
    • Tasker's Scan Media action seems to act in wildly different ways depending on not only the Android version, but also the vendor variant you're using. I've fixed the issue on my devices (and hopefully many of yours) by running a Scan Media action on not only the file in it's destination directory, but also on the original file path (referencing the file that's no longer there).

I also updated variable names for clarity, and rather than using events that trigger when entering or exiting apps, I've set it to run on a File Modified event monitoring the source folder, with the event set to Closed Write. This works for most purposes, but breaks in some cases. You can fix most issues by either using a different event parameter (such as Create, Modify, or Move To) or by using stricter regex in Action 3 of the task.

I've heard that devices with slower storage (or slow external SD cards) can have issues with this if files take too long to write. In that case, you may have to experiment with adding delays or using different methods to trigger the task.

I'm attaching not just the task here, but the entire project I've created, containing multiple copies of the task for various use cases, and their respective profiles to trigger them, so that beginners who are new to Tasker can easily get started using this task and have some examples to reference when adopting the task to their own needs.

The examples included in this project are:

  • When Facebook downloads an image to /sdcard/DCIM/Facebook, move it to /sdcard/Pictures/Facebook.
  • When Samsung Notes saves an image to /sdcard/DCIM/Samsung Notes/, move it to /sdcard/Pictures/Samsung Notes/. (This works, but Samsung Notes will claim it failed to save the image, due to it checking for the image after it has already been moved by Tasker.)
  • When you create a GIF using Smart Select, move it from /sdcard/DCIM/GIF/ to /sdcard/Pictures/Smart Select GIFs/.
  • When you export an APK from ReVanced Manager to /sdcard/Download/APKs/Original/, move it to /sdcard/Download/APKs/Modded/.
  • When a new file is detected in /sdcard/Download/ . . .
    • if it's a download from Craiyon, move it to /sdcard/Pictures/Craiyon/
    • if it's an APK, APKM, APKS, or XAPK file, move it to /sdcard/Download/APKs/Original, unless it is base.apk (I leave that file in Download since I use it for other things.)

Remember to first create the source and destination directories before testing the examples. I also encourage you to check Action 3 in each example task (some of them use simple matching and others use regex) for a better understanding of how they work.

Now that that's out of the way, here's the project. You can import it directly to Tasker from there, or download it as an XML. If you choose to download it, save it in /sdcard/Tasker/projects/. You can then long press on the home icon on the bottom left corner of Tasker to import the project.

Unfortunately the entire XML is too long to post here directly, but for the sake of keeping this answer as complete as possible, I'm including the XML for just the Facebook task below. I strongly recommend that beginners import the entire project using the link above however, so you can get an idea of how to customize the task for your own needs.

The Facebook task:

<TaskerData sr="" dvi="1" tv="6.0.10">
    <Task sr="task3">
        <cdate>1489093858387</cdate>
        <edate>1677367714628</edate>
        <id>3</id>
        <nme>Move Facebook Images</nme>
        <pri>6</pri>
        <Kid sr="Kid">
            <launchID>3</launchID>
            <pkg>me.regalstreak.movefb</pkg>
            <vTarg>21</vTarg>
            <vnme>1.0</vnme>
        </Kid>
        <Action sr="act0" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">/sdcard/DCIM/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act1" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%destdir</Str>
            <Str sr="arg1" ve="3">/sdcard/Pictures/Facebook/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act10" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%fileexists</lhs>
                    <op>12</op>
                    <rhs></rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act11" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act12" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act13" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act14" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Str sr="arg1" ve="3">%currentfilename(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act15" ve="7">
            <code>890</code>
            <Str sr="arg0" ve="3">%namelen</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act16" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename(%namelen)</Str>
            <Str sr="arg1" ve="3">%currentfilename(%namelen)%null()(%suffix)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act17" ve="7">
            <code>592</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">.</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act18" ve="7">
            <code>135</code>
            <Int sr="arg0" val="0"/>
            <Int sr="arg1" val="10"/>
            <Str sr="arg2" ve="3"/>
        </Action>
        <Action sr="act19" ve="7">
            <code>38</code>
        </Action>
        <Action sr="act2" ve="7">
            <code>412</code>
            <Str sr="arg0" ve="3">%sourcedir</Str>
            <Str sr="arg1" ve="3">*.jpg/*.png/*.jpeg/*.gif/*.3gp</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Str sr="arg5" ve="3">%filelist</Str>
            <Int sr="arg6" val="1"/>
        </Action>
        <Action sr="act20" ve="7">
            <code>400</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
        </Action>
        <Action sr="act21" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
        </Action>
        <Action sr="act22" ve="7">
            <code>459</code>
            <Str sr="arg0" ve="3">%destdir%currentfilename</Str>
        </Action>
        <Action sr="act23" ve="7">
            <code>888</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Int sr="arg1" val="1"/>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act24" ve="7">
            <code>40</code>
        </Action>
        <Action sr="act25" ve="7">
            <code>37</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>0</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act26" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">No memes? Sad.</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act27" ve="7">
            <code>43</code>
            <ConditionList sr="if">
                <Condition sr="c0" ve="3">
                    <lhs>%counter</lhs>
                    <op>0</op>
                    <rhs>1</rhs>
                </Condition>
            </ConditionList>
        </Action>
        <Action sr="act28" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter meme moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act29" ve="7">
            <code>43</code>
        </Action>
        <Action sr="act3" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%suffix</Str>
            <Str sr="arg1" ve="3">1</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act30" ve="7">
            <code>548</code>
            <Str sr="arg0" ve="3">%counter memes moved!</Str>
            <Int sr="arg1" val="0"/>
            <Str sr="arg10" ve="3"/>
            <Int sr="arg11" val="1"/>
            <Int sr="arg12" val="0"/>
            <Str sr="arg13" ve="3"/>
            <Int sr="arg14" val="0"/>
            <Int sr="arg2" val="0"/>
            <Str sr="arg3" ve="3"/>
            <Str sr="arg4" ve="3"/>
            <Str sr="arg5" ve="3"/>
            <Str sr="arg6" ve="3"/>
            <Str sr="arg7" ve="3"/>
            <Str sr="arg8" ve="3"/>
            <Int sr="arg9" val="1"/>
        </Action>
        <Action sr="act4" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%counter</Str>
            <Str sr="arg1" ve="3">0</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="1"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act5" ve="7">
            <code>39</code>
            <coll>false</coll>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">%filelist()</Str>
            <Int sr="arg2" val="0"/>
        </Action>
        <Action sr="act6" ve="7">
            <code>590</code>
            <Str sr="arg0" ve="3">%currentfilepath</Str>
            <Str sr="arg1" ve="3">/</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
        </Action>
        <Action sr="act7" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%pathlen</Str>
            <Str sr="arg1" ve="3">%currentfilepath(#)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act8" ve="7">
            <code>547</code>
            <Str sr="arg0" ve="3">%currentfilename</Str>
            <Str sr="arg1" ve="3">%currentfilepath(%pathlen)</Str>
            <Int sr="arg2" val="0"/>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="0"/>
            <Int sr="arg5" val="3"/>
            <Int sr="arg6" val="0"/>
        </Action>
        <Action sr="act9" ve="7">
            <code>342</code>
            <se>false</se>
            <Int sr="arg0" val="4"/>
            <Str sr="arg1" ve="3">%destdir%currentfilename</Str>
            <Str sr="arg2" ve="3">%fileexists</Str>
            <Int sr="arg3" val="0"/>
            <Int sr="arg4" val="1"/>
        </Action>
        <Img sr="icn" ve="2">
            <cls>com.facebook.katana.LoginActivity</cls>
            <pkg>com.facebook.katana</pkg>
        </Img>
    </Task>
</TaskerData>

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .