organize icon indicating copy to clipboard operation
organize copied to clipboard

Copy a file only once

Open hackmonker opened this issue 3 years ago • 2 comments

So my workflow needs me to copy any new file added to a folder to another folder. I setup the config in that way and use inotify to run the command everything is fine. only that when I add two files, the command copies the first file twice since the command is run twice. Is there a way so that when the command is run the second time, it only copies the new files and not the old files again?

hackmonker avatar Jan 10 '22 06:01 hackmonker

If I understand this correctly you need a mechanism to detect if the file has ever been handled by organize, right? Most people just move the original file to a handled folder or rename it. Could you upload your config if I understood this wrong?

tfeldmann avatar Jan 28 '22 09:01 tfeldmann

sorry for the late reply. I was having my exams. yes exactly. if organize ever handled a file then to skip it. I cant move or rename the files from my source since some other app looks at them. so I symlink from my source to a temp folder where I process them and then move them to another dest. I wanted to use organize for symlinking from source to temp whenever new files are added to source

rules:
  - name: "Move M4Bs to temp for further processing"
    locations:
      - /mnt/local/downloads/audiobooks/original
    subfolders: true
    filters:
      - extension: m4b
    actions:
      - symlink: "/mnt/local/downloads/audiobooks/temp"

  - name: "Move Mp4s to temp for further processing"
    locations:
      - /mnt/local/downloads/audiobooks/original
    subfolders: true
    filters:
      - extension: mp4
    actions:
      - symlink: /mnt/local/downloads/audiobooks/temp

hackmonker avatar Mar 13 '22 08:03 hackmonker