#767

The copying rules are kept in the text file synchronize_folders.txt. The path to it is set on the «Settings» tab, where there is also a table in which the folder pairs can be added and edited without a text editor.

The line format

One line — one rule:

from where > to where type

  • from where — the full path to a folder inside the orders working folder. Not to a file and not with a * mask — only an exact folder.
  • to where — the full destination path: the letter of a mapped drive or a network path like \\server\share.
  • type — folder or file.

Between «from where» and «to where» there is the > sign with spaces on both sides, and before the type there is a space. Empty lines and lines starting with # are ignored — that is a convenient way to keep comments and temporarily disabled rules.

The folder mode — keeping the structure

The source folders are recreated in the destination as they are: if there were subfolders by order and by part, there will be there too. This is the default mode and the right choice for almost all machines.

The file mode — everything into one folder

The files are placed in the destination flat, without subfolders. This is needed, for example, for a label printing queue, where the printer simply takes the files from one folder one after another.

Important: when the names coincide, the file is overwritten — the last one copied wins. Use file only where the file names are certain to be unique.

The order of the rules

  • The folder rules are always executed before the file rules, regardless of the order of the lines in the file.
  • If two file rules write into the same folder, the last one will overwrite the files of the first.

Spaces in the destination path

Spaces in the destination path are replaced with an underscore: Z:/cnc/kdt center will turn into Z:/cnc/kdt_center. This is done because of machine software that digests spaces in paths badly. Take this into account when you create the folder on the server: the name must match what comes out after the replacement.

An error in one line does not break the rest

If a line could not be parsed, a «Bad line in …» entry with the text of the line will get into the log, and the program will continue with the rest of the rules. If the type says anything other than folder and file, the rule will be executed as folder, and there will be a warning in the log.

When the changes take effect

On the next cycle. There is no need to restart the program; if you do not want to wait — press «Check now».

What to remember when editing through «Settings»

The table of folder pairs on the «Settings» tab overwrites the file entirely. Comments and commented-out lines are lost in the process. If you keep notes in the file, edit it with a text editor.

What is better not to do

  • Setting the orders working folder itself, or a folder inside it, as the destination — you would get copying into itself.
  • Going too deep with the source (down to a specific machine folder inside the machine folder): if the structure on the server changes, the rule will stop finding the files. It is better to take one level higher.

Ready-made lines for different machines are collected in the article Route examples for different machines. Which folders there are in the working directory at all — in the article The folder structure of an order.