Skip to content

--folder-structure fails when running under systemd #1289

@cadeon

Description

@cadeon

Overview

When systemd --user runs icloudpd using the below:

ExecStart=/home/<user>/.local/bin/icloudpd --username <user>@me.com -d /home/<user>/Pictures/iCloud-Photo-Library/ --folder-structure {:%Y} --auto-delete --set-exif-datetime --cookie-directory /home/<user>/.icloudpd

The first few files come in at the expected folder ( /home/<user>/Pictures/iCloud-Photo-Library/2025/image.jpg ) but....

... then something happens... maybe a name collision or something... and the files start being written to ... /home/user/.config/systemd/user/ ! (the location of the service file) notably without 2025 (or any other year folder).

Running without the --folder-structure {:%Y} or running with --folder-structure none seems to avoid triggering the bug. I was able to download my whole library using the default folder structure.

Steps to Reproduce

  1. Maybe you need a library like mine with some name collision or something to trigger the bug
  2. Create a systemd (--user) unit file per above
  3. Run the service and watch it break

Note I did not see this behavior running outside of systemd. So I assume it has something to do with the environment when invoked that way.

Expected Behavior

Everything gets downloaded to the directory and folder-structure specified

Actual Behavior

See above

Context

Only seen when executed from systemd, have not seen this behavior running directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions