WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
Page Index Toggle Pages: 1
Copy with backup (Read 2135 times)
YaBB Newbies

Posts: 1
Copy with backup
Mar 12th, 2010 at 10:34am

Im trying to configure a kind of advanced copy script;  my issue is this:

Input folder:   \changedjpg\<file.jpg>

Output folder: \images\<year>\<month>\<day>\<file.jpg>

Where year, month, day is always todays date, so if i put an image named file.jpg in \changedjpg today i want it to be copied to \images\10\03\12\file.jpg.

So far so good, i managed to get it working with dynamic naming, but since this is a production environment i want to make a backup before overwriting the image, i cant find a way to make it combined with dynamic naming.

it would be nice to copy the file only if destination exists, but thats not crucial.

Im also looking for a more advanced copy function, that searches a couple of subdirectories and copies the file to the directory where the file already exists, for example:


if i put a image in \changedjpg named dance.jpg the script would replace the file \images\news\10\03\12\dance.jpg, but not \images\news\10\03\10\dance.jpg

Could this be done with watchDirectory?

Back to top
IP Logged
YaBB Administrator

Posts: 2270
The Netherlands
Re: Copy with backup
Reply #1 - Mar 12th, 2010 at 10:42am
If you want to copy a file to multiple destinations (your "backup"), you have 2 options you can use with WD.

1. Use "Sort Files" instead of "Copy"
If you set "Final Rule"  to No, one detected file can trigger multiple copy's.

2. Use the "Run SubTasks" plugin
You can import your current "copy" task so it will become a sub-task.
Then create another SubTask (maybe by importing the "copy" again) for the backup location

If you use
as the dynamic name, your dance.jpg will always be copied to the correct "news" sub-directory, based on today's date.

Back to top

Gert Rijs - gert (at) gdpsoftware (dot) com
End Alzheimer's:
WWW WWW GdPSoftware  
IP Logged
Page Index Toggle Pages: 1