Move files after run profile

For technical support visit http://support.2brightsparks.com/
Post Reply
cmcruz007
Enthusiastic
Enthusiastic
Posts: 12
Joined: Fri Jun 11, 2010 8:18 am

Move files after run profile

Post by cmcruz007 » Wed Sep 05, 2018 8:08 am

Hi everyone,

Is it possible to move files to another folder after running a profile?

I copy files from source to destination, and if the copy is correct, I want to move them to another folder in source as "processed".

Thanks!

cliffhanger
Expert
Expert
Posts: 847
Joined: Tue May 31, 2011 5:59 pm

Re: Move files after run profile

Post by cliffhanger » Wed Sep 05, 2018 12:59 pm

Hi, there's no dedicated function to do this: for example, you could make a Group with a 'copy' profile and a 'move' profile (in that order) but there's no way to configure any dependency of the 2nd profile upon success ('no errors') or otherwise of the 1st profile.

However, you can probably do it by cheating slightly using the Modify profile > Expert mode > Programs-Before > After functionality in your Copy profile to run a second instance of Pro that calls the Move profile via command-line. Note that Programs-Before > After will by default only run the 2nd instance/profile if the first instance/profile did not fail (that is to say, if its Result = Success) unless you use the relevant override option to sidestep it, which sounds 100% undesirable in your case.

You can generate a suitable command-line by creating a desktop shortcut to the Move profile (drag profile to desktop to create one), edit the shortcut, Copy the command-line inside it and Paste it into the relevant box in Programs > After. For example, on my 64-bit Windows 10 system, using the 64-bit version of SyncBackPro, my command-line to run a copy of Pro > a profile would be

"C:\Program Files\2BrightSparks\SyncBackPro\SyncBackPro.exe" "Name Of Desired Move Profile"

but if your system or program version differ(s)* you may need to adapt accordingly or use the shortcut trick to get an accurate CL (note: make sure you use the double-quotes). You should also give some thought to the other checkbox options in After section in case they are desirable in your case, but from what you say so far, they all look as though you can leave them in the default config (I.e. off, unchecked - except the top one, obviously!) so that you only need to set the top option and paste in your command line.

Note that this will briefly result in 2 copies of Pro running at the same time but by default (unless you configure the opposite), the original instance will self-close after calling the 2nd instance (and doing its own final housekeeping, e.g log file), so the extra resource drain should be brief/negligible.


* it's helpful when posting a question if you quote the version number (x.x.x.x) of SB, and your OS flavor, also the 'bitness' of both. The above is based on Pro V8.5.72.0 X64

cliffhanger
Expert
Expert
Posts: 847
Joined: Tue May 31, 2011 5:59 pm

Re: Move files after run profile

Post by cliffhanger » Wed Sep 05, 2018 5:41 pm

BTW it occurs to me that the above does not guarantee a file will have been copied via profile-1 before being moved via profile-2.

Imagine a case where profile-1 starts at 18:00, tales 5 minutes to scan and 10 minutes to copy anything it found (that qualifies for copying). If a new file only arrives in your common Source (say at 18:10) such that profile-1 did not see it as part of its own scan, it will not be copied (because when profile-1 looked, it wasn't there yet).

But, when profile-2 (the move-profile) runs c/o the call from profile-1 (say at approx 18:15) it will see the file that arrived at 18:10 and move it (despite it not having been copied yet). If you could arrange things so profile-2 would borrow/use the scan results of profile-1, it might work, but there's no way to do that. Each profile will determine the state/contents of the Source file-set for itself, as close as possible to 'at a frozen moment' (more accurately, in this case, at two different 'frozen moments')

AFAICS there is no way to ensure only previously-copied files get moved unless you can segregate things so that profile-1 followed by profile-2 both run at a time when no new files are arriving in the Source (for example, after new files have stopped arriving one evening but before they start arriving next day). But I think a constant procession of files cannot be safely handled (by its very nature)

Post Reply