taFileSync (in the following termed "the APP") is an application for synchronizing two directory trees on the local file system. It can for example be used to synchronize the storage card with an OTG (on-the-go) USB stick or to make a backup of the internal to the external storage card.

taFileSync

What is taFileSync?
Define sync jobs
Preview differences
Using with other applications
Debugging
Legal issues

1. Introduction

taFileSync (in the following termed "the APP") is an application for synchronizing two directory trees on the local file system. It can for example be used to synchronize the storage card with an OTG (on-the-go) USB stick or to make a backup of the internal to the external storage card.

The APP has following features:

  • 1-way and 2-way sync
  • unlimited number of sync jobs
  • preview of differences
  • time offset handling
  • compare text files by content (needs the app taTextDiff)

There is a PRO key app (taFileSync PRO) which will activate additional features in this app here:

  • You can define a list of directories which will be left out during compare.
  • Multiple time offsets can be ignored.
  • The job option 'Log' writes a log file with the synchronisation operations
  • Jobs can be run automatically (e.g. with Tasker)
  • SEND Intent allows to pass 2 directories to create the _temp Job (e.g from TotalCommander)
  • VIEW Intent for *.json files allows to pass data to the APP

top

2. Define sync jobs

The APP allows to create an unlimited number of sync jobs. The jobs can be sorted by name or ordered manually using cut and paste. The job list is saved in the file /sdcard/Android/data/ch.tanapro.taFileSync/JobList.dat

When defining a sync job, you need to specify whether you want to make a 1-way or a 2-way sync. A 1-way sync is a mirroring process which will make the tree 2 the same as tree 1. It will copy files from tree 1 to tree 2, even if the files in tree 2 are newer. It will also delete files and directories in tree 2 that are not present in tree 1.
A 2-way sync will copy newer and missing files from tree 1 to tree 2 and also from tree 2 to tree 1.

You can define a list directories which will be left out when comparing the two trees (PRO only).

You can define a time offset in seconds. If the timestamp of a file in tree 1 differs exactly by this amount of seconds from the timestamp of the file in tree 2, the two files are considered to be of the same age. Files with the same timestamp are always considered of the same age, regardless of the defined time offset. With the PRO key installed, the APP will allow you to define multiple time offsets, separated with blanks. If under Android 4 4.x, you are synchronizing the internal with the external storage card, you should ignore the time offset of 1 second.

On some file systems (e.g. internal storage card on Jelly Bean) it is not possible to modify the timestamp of a file copied to the target directory. In this case the option 'Update source timestamp' will update the timestamp of the source file instead to make the synchronisation possible.

If you cannot set the file timestamps neither in tree 1 nor in tree 2 the comparison can only be done by file content (is slow, unfortunately!). Set the options 'Compare by content' and 'Ignore file timestamps' to true.

top

3. Preview differences

When a job is started, it first analyses the differences between the two directory trees and shows them in a list. The list shows how the file in tree 2 compares to the file in tree 1:

< the file in tree 2 is older
- the file is missing in tree 2
> the file in tree 2 is newer
+ the file is missing in tree 1
# the files have the same timestamp but not the same size or content

For 1-way sync jobs the last three cases above bear the risk of loosing data or overwriting data that was newer in tree 2. Therefore, these cases will be shown in red in the difference list.

From the preview screen, you can start the sync process by choosing 'Synchronize' from the main menu. After a confirmation the two trees will be synchronized. The process can be aborted by pressing the hardware 'back' button.

For 2-way sync jobs, files of the last case (#) will not be copied and will remain in the difference list when the sync job is done.

top

4. Using with other applications (PRO only)

You can use this APP together with other apps like TotalCommander or Tasker. To pass data to this APP, following JSON objects are used:

For auto sync:

{
  "stOperation": "opAutoSync", 
  "stUniqueID": "1408424060830"
}

where the value of stUniqueID is the unique ID of the job to be executed.

For adhoc directory compare:

{
  "stOperation": "opAdhocDiff", 
  "stDir1": "/sdcard/d1/", 
  "stDir2": "/sdcard/d2/"
}

The JSON objects can be passed by following ways:

  • Data URI of the MAIN Intent (e.g. with Tasker):
    data:application/json,{"stOperation": "opAutoSync", "stUniqueID": "1408424060830"}
  • Data URI of the SEND Intent (e.g. with TotalCommander):
    url:data:application/json,{"stOperation": "opAdhocDiff", "stDir1": "%P", "stDir2": "%T"}
  • Data URI of the VIEW Intent (with any filemanager): Here, you create a text file (with the extension .json) which contains the JSON object. Then, you just tap on the file in the filemanager or choose the APP from the 'open with' dialog. This will send the file's URL to the APP which will read the data from the file.

When an opAutoSync job is done, following message will be put into the clipboard:
taFileSync: opAutoSync done, job: uniqueID
This will allow other apps like Tasker to wait for the end of the first taFileSync job before starting another one.

top

5. Debugging

If you have problems with the APP, you can set the Log Level in the APP settings to analyse them. If you define a value higher than NONE, the APP will log informationen to the logcat. The highest amount of information is written with log level VERBOSE. The logcat information can be viewed by choosing 'LogCat' from the main menu. It shows log information from the APP and from the Android system. The log can be filtered and copied to the clipboard.

top

6. Legal issues

Thank you for choosing this SOFTWARE! You may only use this SOFTWARE if you agree with the conditions listed further below:

COPYRIGHT
This SOFTWARE has been developed by Tanapro GmbH, www.tanapro.ch, (in the following termed AUTHOR). All rights reserved.

NO WARRANTY
The SOFTWARE is provided AS IS without a warranty of any kind. All express, implied or statutory warranties, including any implied warranty of merchantibility or fitness for a particular purpose, are hereby excluded. The AUTHOR does not warrant that the SOFTWARE is fail-safe or error-free. The user must bear all risks when using the SOFTWARE.

NO LIABILITY
In no event will the AUTHOR be liable for direct, indirect or consequential damages related to the use (or the inability of the use) of the SOFTWARE, even if the AUTHOR has been advised of the possibility of such damages.

top

Additional information