Advanced Scheduled Synchronization with TurboFTP

FTP sync is a process where, through File Transfer Protocol, files are synchronized to or from an FTP or SFTP server so that they can be backed up, shared with certain parties, or fed to a back-end system promptly.

Benefits of FTP and SFTP Sync with TurboFTP Client:

  • Choose one of the flexible FTP sync schemes to do a selective sync or simply mirroring.
  • Protect your data in transit with a secure FTP/SFTP channel protected with industrial-strength cryptography.
  • The Built-in Open PGP feature offers the option to add an extra layer of protection to your data in transit and even at rest. Open PGP encryption is a much more reliable way to ensure the safety of data stored in the public or private cloud.
  • Relentless attempts to automatically retry interrupted transfers with checkpoint restart in any hostile network environment - are critical to ensure delivery of your valuable data on schedule and complete.
  • Email notification upon successful delivery or error.

How to Synchronize Data?

With the TurboFTP client, synchronizing data is easy to set up and test drive with the GUI without scripting. An FTP or SFTP server such as TurboFTP Server must be running to allow TurboFTP to sync files against. The following guide will help you to sync data on FTP/SFTP properly.

1. Concepts

Source and Destination

The source and destination folders are defined based on the synchronization direction. For example, if the sync direction is Download, the remote folder is the source folder, and the local folder is the destination folder.

 TurboFTP Task Scheduler interface showing a task list with columns for Task, ID, Run Times, and Dependency. Buttons for managing tasks are below.


2. Synchronization Schemes


Dropdown menu titled "Synchronization Scheme" showing options like "Add only new files to destination" highlighted, amid various file update choices.

Synchronization Schemes define how TurboFTP chooses files to transfer after the file comparison is done. We will explain each of the available Synchronization Schemes in TurboFTP by examples.


2.1 Add only new files to the destination

Only transfer new source files.

EXAMPLE 1: Only transfer new source files. No file timestamp comparison is involved.

A Notepad window open with the text 'text text'. Below, two file directories show 'root.txt' with different sizes and timestamps.


2.2 Update only existing files at the destination


Transfer files that overwrite old copies in the destination folder.

EXAMPLE 2: TurboFTP will compare local and remote file timestamps under this scheme. In this example, the local file root.txt exists locally and remotely, and the local copy is newer. After the synchronization, the local copy of root.txt is uploaded, while test.php is not.

direction
Split screenshot of two file directories named "test." The left shows "test.php" and "root.txt"; the right shows only "root.txt" with details like size and date.

2.3 Update and add new files to the destination

Transfer new and updated source files that overwrite old copies in the destination folder.

EXAMPLE 3: the local copy of root.txt is newer, and after synchronization, it is uploaded. The local folder has test.php, which the remote destination folder doesn't have; therefore, test.php is uploaded as a new file.

Before action:

Split screen showing Notepad with text content at the top and a file directory below, displaying file names, sizes, and modification dates.

After action:

Notepad window showing simple text repeated three times above an FTP client interface with two directories. File transfer arrows are displayed.


2.4 Update, add new, and remove unique files at the destination


Transfer new and updated source files that overwrite old copies in the destination folder and remove orphan files in the destination folder. Unique/orphan files exist at the destination but not at the source.

EXAMPLE 4: Note that 'have.rar' at remote doesn't exist locally and is seen as a unique file. Therefore it is removed after the action.

Before action:

direction
Two file explorer windows show directories. The left window displays "test" with two files, and the right shows a directory with three files.

After action:
Split screen of two file directories. Left: folder "test" with "root.txt" and "test.php" files. Right: similar folder, different path and timestamps.


2.5 Transfer files added or updated since the last sync

Compare time stamps of source files with the last run time of the task; if it is newer, transfer them to the destination. With this scheme, file size comparison is not applicable. The first time the job runs, all source files will be transferred since there is no valid 'last runtime'.

EXAMPLE 5:

After the 1st execution of the task:

direction
Split-screen image of two file directory windows. The left shows "test" directory with "root.txt" and "test.php" files. The right shows "tbswork1" with similar files. Both share file sizes and dates, suggesting a comparison.

Then root.txt is modified, and the task is executed again. This time the file 'test.php' is uploaded because its timestamp is newer than the last run time.

Side-by-side file directory comparisons show "root.txt" and "test.php" with details like size and modification date. The right side highlights "root.txt" in red.


2.6 Remove duplicate files at the destination


Find out files that exist both locally and remotely and remove the copies at the destination.

Before action:

direction
File comparison image showing two directory windows. Both list "have.rar," "root.txt," and "test.php." Each file includes size and modification dates.

After action:

Two file explorer windows display directories. The left window shows files like "have.rar" and "root.txt," while the right shows "test1.php."

2.7 Transfer all source files

Transfer all files in the source folder, overwriting any existing files at the destination.

EXAMPLE 6: as illustrated below, all files are transferred regardless of whether the destination folder has them or not.

Before action:

direction
Split screen view showing two directory windows. The left window lists files like "root.txt" with details, while the right shows an empty directory.

After action:

After synchronization both local and remote directories contain same items.

2.8 Transfer all source files and remove unique files at the destination

Transfer all files in the source folder, overwriting any existing files at the destination. Remove orphan files in the destination folder. This is an option for 100% mirroring without caring about the result of file comparisons between both sides in terms of file time or file size.

EXAMPLE 7:

Before action: the orphan file 'have_no.rar' at the destination is removed after the action.

direction
Two file directory windows side by side show file details. The left directory lists files like "root.txt" and "have.rar." The right features "have_no.rar."

After action:

Two side-by-side file directory windows display lists of files with names like root.txt and have.rar. The right window highlights have.rar.


3. Other Options for Synchronization


Checkbox options for a file synchronization program, including "Include subfolders," "Ignore file name case," and "Show subfolders at bottom."

Explanation of the above options:

3.1 Include subfolders: whether synchronize subfolders as well.

3.2 Ignore file name case: when comparing local and remote files, ignore file name case difference.

3.3 Compare file size rather than file time: TurboFTP compares file time stamps during synchronization by default. Due to the limitation of regular FTP, where time in remote file listing is within the accuracy of a minute, you might want to decide which files to transfer based on the file size difference in bytes. If this option is selected and the source file size differs from the destination file size, TurboFTP will consider the source file 'newer'.

3.4 The last two options only relate to the visual comparison of Folder Synchronization in TurboFTP and will be ignored when doing automated synchronizations.


4. Execute external programs during synchronization


TurboFTP allows you to interface your workflow processes with its synchronization action. External programs can be executed before the task, after the task, and against each downloaded file(locally) or uploaded file.

Settings for running programs, with fields for "Before task," "After task," "Each downloaded," and "Each uploaded file," plus a checkbox labeled "Wait until program terminates" that is checked.

4.1 Execute Programs before Task

EXAMPLE 8: Pack local files into an archive, and upload the archive to a remote server.

We create a batch file for archiving with a command line archiver like RAR.

archive.bat
"C:\Program Files\WinRAR\Rar.exe" a "C:\123\test\test.rar" "C:\123\test\test.php"

As illustrated below, we specify archive.bat to be executed before the task:

Interface showing options to run programs before and after tasks, and after file downloads or uploads. A path is set for "Before task."

As we only want to upload archives, we set up an inclusion file filter:

Buttons labeled "Include Filters" with a blue outline and "Exclude Filters" with a black outline, contrasting colors for emphasis.

Include Filters dialog box with options to set file filters, size, time range, and attributes. Buttons for OK and Cancel are at the bottom.

Before the task runs, both the local and the remote folders have the same set of files:


File manager showing two directories. The left pane is "test" with "test.php" and "root.txt." The right pane is "/home/t/b/tbswork1" with "root.txt" and "test.php."

After it runs, the local files are packed into test.rar and uploaded:

Two file directory windows showing lists of files. Left: test.php and root.txt. Right: root.txt, test.php, and test.rar. Both directories have modification dates from 2010.

4.2 Run program after task

EXAMPLE 9: Download a remote archive and extract it into a local folder.

expand.bat
"C:\Program Files\WinRAR\UnRAR.exe" e "C:\123\test\test.rar" "C:\123\test\"

We specify expand.bat to be run after the task.

Dialog box titled 'Run Programs' with fields for 'Before task:', 'After task:' showing a file path, 'Each downloaded', and 'Each uploaded file:'. Checkbox labeled 'Wait until program terminates' is selected.

Buttons labeled "Include Filters" with a blue outline and "Exclude Filters" with a black outline, contrasting colors for emphasis.

Include Filters dialog box with options to set file filters, size, time range, and attributes. Buttons for OK and Cancel are at the bottom.

Before action, the local destination folder is empty. We use a sync task to download archives to the local folder, then extract all files from archive test.rar.


Split image of two file directories. Left: "test" with only "Parent Directory." Right: "/home/t/b/tbswork1" showing files: root.txt, test.php, test.rar.

After action:

Split screen image showing two file directory windows. The left window is labeled "test" and the right is "/home/l/b/tbswork1", both with similar text files listed.

 

4.3 Execute external program against each downloaded file

EXAMPLE 10: Add each downloaded file to an archive

We have an archive back.rar and will add each downloaded file to it.

addarchive.bat
"C:\Program Files\WinRAR\Rar.exe" a "C:\backup\backup.rar" %1

Screenshot of a 'Run Programs' dialog box with fields for tasks to run commands before, after, and for each file. Checkbox labeled 'Wait until program terminates' is checked.

Before task runs:

Two identical green left-pointing arrows on a white background. The arrows are simple in design, conveying a sense of direction or navigation.
Two side-by-side directory views. Left shows an empty "test" folder. Right displays "root.txt" and "test.php" files with timestamps in "/home/t/b/tbswork1".

When the task is done, files are downloaded and added to the archive:

Two file explorer windows. Left: Folder "test" with files "root.txt" and "test.php," both 0 bytes, dated 2010-4-22. Right: Similar folder with same files.

Screenshot of a file directory from a RAR archive named "backup.rar\123\test" showing a folder icon and two files: "root.txt" and "test.php".

You can also delete or move each downloaded or uploaded file.

Dropdown menu screenshot for file actions, with "Delete" option selected after download, and "Do nothing" chosen after upload; interface has a simple design.

Please note that the path we move files to is a remote folder path under After Download.

4.4 Execute a program against each uploaded file

EXAMPLE 11: Extract a backup archive and upload extracted files to a remote folder.

We use the following script to extract a backup archive in a temporary folder.

expand.bat
"C:\Program Files\WinRAR\UnRAR.exe" e "C:\backup\backup.rar" "C:\123\test\"

While the task runs, we delete each uploaded local file.

del.bat
del %1

A software interface shows fields for running programs before and after tasks, displaying file paths with folder icons. A checkbox for 'Wait until program terminates' is selected at the bottom.

Before action: the local and remote folders are empty.

Two green arrows pointing to the right, side by side
Split image of two file directory windows. Left shows a folder named "test," right shows a directory path "/home/t/b/tbswork1," both with "Parent Directory."

After action:

Split-screen of two file directory windows. The left shows an empty “test” folder. The right shows a folder with two files: "root.txt" and "test.php".

You can also use TurboFTP's built-in function to delete/move uploaded files.

Dropdown menu options in a software interface. "After Download" set to "Do nothing," and "After Upload" set to "Delete," both in shaded text boxes.