Batch files, startup and basic questions

Get help for specific problems
Posts: 2
Joined: 4 Jan 2012

improbulus

Hi, first of all I'd like to say congratulations and thank you to Zenju for
all your hard work on this very worthwhile project!

I've just been testing FreeFileSync and RealTimeSync, and would be grateful if
you could clear up some issues and answer a few queries please?

In the examples below, they are all meant to be mirror syncs. I set up the
folder pairs in FreeFileSync, saved the config, went Advanced to Create a
batch job, saved as .ffs_batch, went to RealTimeSync, loaded the _batch if
necessary (mostly already filled in correctly), then saved the settings there
to .ffs_real to create the test ffs files.

I've been playing with a batch file to be run on startup (Win 7 Pro 64 bit),
in order to start several instances of RealTimeSync, each with a different
folder pair to watch.

I found that this command works
start "C:\Program Files\FreeFileSync\RealTimeSync.exe" "K:\My
Documents\Backups\test.ffs_real"

However this command works only once, in that it does do an initial sync, but
after that it won't update the destination folder whenever files in source
folder change
start "C:\Program Files\FreeFileSync\RealTimeSync.exe" "K:\My
Documents\Backups\test.ffs_batch"
Why doesn't it monitor for real time changes, and how can I fix this please?

(Strangely, in the RealTimeSync GUI, if I enter in the commandline box:
"C:\Program Files\FreeFileSync\RealTimeSync.exe" "K:\My
Documents\Backups\test.ffs_real"
it throws an error: "The file does not contain a valid configuration
"...\test.ffs_real"
However it accepted this in the command line:
"C:\Program Files\FreeFileSync\RealTimeSync.exe" "K:\My
Documents\Backups\test.ffs_batch"
ie, it's the other way around! Why won't the command line box accept a _real
file, but only _batch files? I thought both were supposed to work?)

This command won't do anything at all, whether I pass the _real OR _batch
file. It won't even do an initial sync.
start "C:\Program Files\FreeFileSync\Bin\RealTimeSync_x64.exe" "K:\My
Documents\Backups\test.ffs_real"
Why doesn't it work please?

To run several RealTimeSyncs at startup, is the best way just to add the
various .ffs_real files to my Startup folder? I haven't tested that yet to see
if it continues to monitor after the first sync, but will do so on my next
startup. (And I assume that if I add just ffs_batch files to the Startup
folder, FreeFileSync will do a sync on startup?)

I think I saw elsewhere in the forum that you mentioned that you could drag
multiple .ffs_batch files to the RealTimeSync GUI to create one instance that
can run several jobs, but when I tried to do that, it only brought the path to
the parent folder for those ffs_batch files into RealTimeSync? How can I
create a batch or real file that will watch several folder pairs please?

Also, RTS seems to copy files that already exist? Suppose I had a folder on my
main drive X called Folder1, and I copied Folder1 to another drive Y some time
ago. So Folder1 on drive Y was missing some files I'd recently added to
Folder1 on drive X. I set up RealTimeSync (mirror) between Folder1 on drive X,
and Folder1 on drive Y. However, instead of copying just the recently added
files from X to Y, it copied all of the files all over again, overwriting
the unchanged files that were already on drive Y. Why is that, and how can I
stop this happening please with other folders? Is it because I'd edited the
globalsettings.xml to set "VerifyCopiedFiles" to true? I thought it would
verify newly copied files only, but does that setting make it always copy and
verify even unchanged files?

As regards the operation of RealTimeSync, may I also ask please - as far as I
can tell it doesn't seem to cost much in terms of CPU/RAM or checking my
drives for changes, but obviously I want to avoid it continually accessing my
drive every few seconds to check the monitored folders. Multiplied by several
instances, could it slow things down on my computer or increase the load on my
drives significantly? I'm not sure how it all works, and eg whether it's
better to have one instance than several to run multiple monitorings (and if
so, how).

While I write, a small suggestion - I realised the toolbars are moveable, but
why not have them default to being aligned along the top, as is common with
toolbars, rather than at the bottom of the screen? Easier for people to spot
immediately.

Many thanks in advance for any thoughts on the above.
User avatar
Site Admin
Posts: 7086
Joined: 9 Dec 2007

Zenju

>> However this command works only once after that it won't update the
destination
At first RTS executes the command line unconditionally once, after that only
when it receives change notifications from the operating system. In general
one can expect this to work. If the file system does not support change
notifications, RTS should show a corresponding error message.

> Strangely, in the RealTimeSync GUI, if I enter in the commandline box:
RealTimeSync.exe"
Why would you want to start RTS from within RTS? You probably want to start
FFS instead.

>To run several RealTimeSyncs at startup, is the best way just to add the
various .ffs_real files to my Startup folder? I haven't tested that yet
I haven't tested that neither. But I would expect that you need .lnk files for
Windows to automatically execute something placed into the Autostart folder.
Alternatively also Windows scheduler can be used for this task.

> I think I saw elsewhere in the forum that you mentioned that you could drag
multiple .ffs_batch files to the RealTimeSync
This is a feature of FFS, not RTS. But you can use these merged configurations
in RTS, of course.

> Also, RTS seems to copy files that already exist?
RTS doesn't copy any files, FFS does. So you'll need to look at your
.ffs_batch configuration and see what it does.

As regards the operation of RealTimeSync I want to avoid it continually
accessing my drive every few seconds to check the monitored folders.?
The monitoring for change notifications generally is "free", since it's a
fully supported feature of both the OS and the file system. However RTS
additionally needs to check folder existency which is often not notified or it
is not possible to notify, e.g. if user just removes an USB stick without
unmounting. This check is done once per second, but buffered by the OS, so no
problem on this side neither.

>I realised the toolbars are moveable, but why not have them default to being
aligned along the top, as is common with toolbars
The GUI is arranged to have the important features on top, less important ones
at the botton. I think the current representation is a good default view for
everyone, but I have no problem changing the default if there are good reasons
do have a different placement.
Posts: 2
Joined: 4 Jan 2012

improbulus

> At first RTS executes the command line unconditionally once, after that only
when it receives change notifications from the operating system. In general
one can expect this to work. If the file system does not support change
notifications, RTS should show a corresponding error message.


Thanks. It must have been a glitch - I had a situation where after the first
execution, when the source folder changed the destination folder did not
update. However, in testing after that, it seems to be working.


> Why would you want to start RTS from within RTS? You probably want to start
FFS instead.


I think I was confused about the difference between RTS and FFS - I get it now
after taking a look inside the _batch and _real files, RTS just triggers FFS.


> I haven't tested that neither. But I would expect that you need .lnk files
for Windows to automatically execute something placed into the Autostart
folder. Alternatively also Windows scheduler can be used for this task.


Yes I meant shortcuts ie lnk files, sorry for not being clear. Just to confirm
that I've now tested adding to the Startup folder a shortcut to a _real file,
and it works.


> This is a feature of FFS, not RTS. But you can use these merged
configurations in RTS, of course.


Thank you for the clarification. Or I assume I can edit a _batch file to add
an extra sync job, by adding an extra Pair in the FolderPairs section, is that
right please?

Also, is there much difference in terms of efficiency or speed whether you run
several instances each with a different _batch file, or a single instance
monitoring several folder pairs please?


> RTS doesn't copy any files, FFS does. So you'll need to look at your
.ffs_batch configuration and see what it does.


I'll do so, thanks. It may be that I set it to Mirror when I should have used
Update, and Mirror always overwrites files even if unchanged, if I understand
that correctly?

Thanks for the helpful info about how often RTS does checks and how, and about
the toolbars. Personally I think it would be helpful to have the Filter files
and Last used configurations at the top of the screen as well, to make those
more obvious to new users, but that's me - others may disagree!
User avatar
Site Admin
Posts: 7086
Joined: 9 Dec 2007

Zenju

> I assume I can edit a _batch file to add an extra sync job,
> by adding an extra Pair in the FolderPairs section, is that right please?
Yes, you can either have multiple folder pairs for a single sync configuration
or multiple sync configurations having one pair each. In combination with RTS
latter allows a more fine granular trigger, while former always tries toy sync
all folder pairs whenever a change in only one of them is detected (which
isn't an issue if sync'ing them is fast).

> Also, is there much difference in terms of efficiency or
> speed whether you run several instances each with a different
> _batch file, or a single instance monitoring several folder pairs please?
There is no speed gain to expect from running a single RTS session vs multiple
sessions. Internally each directory has to register and wait for change
notifications individually. So it doesn't matter if this happens in a single
or multiple processes.

> Mirror always overwrites files even if unchanged, if I understand that
correctly?
No, it overwrites (and propagates deletions) always except if unchanged. You
see what will happen with individual file pairs if you mouse-hover over the
middle grid in FFS's main dialog after comparison.