Syncdiscs icon

SyncDiscs

Version 1.26


Introduction | Installation | Usage | The main control window | Additional settings | Multitasking and the progress window | The Zone file | Command line | Precautions | Contact

Date/time stamps | Syncjob files

Recent changes | Licence


Disclaimer

Neither David Pilling nor Chris Johnson accept any responsibility for any loss of data which occurs as a result of using this program, whether as a result of correct, or incorrect, operation. You use SyncDiscs at your own risk.


Introduction

What does SyncDiscs do? Quoting from David Pilling's original help file:

"SyncDiscs makes the contents of two discs or directories the same. I wrote it to allow me to keep an exact copy of my hard disc on a removable disc. No doubt it would also be of use for synchronising a portable computers disc with that on a main machine."

SyncDiscs was originally written by David Pilling. With the full agreement and encouragement of David, Chris Johnson has taken on the maintenance and development of SyncDiscs.

A consequence of this is that all correspondence about SyncDiscs should now be directed to Chris Johnson (Email: chris@chris-johnson.org.uk), and not to David.


Installation

For a new installation, simply drag and drop the SyncDiscs application into the directory of your choice.

If you have a previous copy of SyncDiscs you have two choices.


Usage

ibarmenu.png - 4KbSyncDiscs is run in the usual way by double clicking on its icon. It will install on the icon bar. The icon bar menu offers the following options.

Info  –  this leads to the standard information window, which also contains a web button, allowing a quick way of accessing the download site.

Help...  –  will launch the documentation (this file) in the default browser.

SyncDiscs  –  will open the main control window. The same action can be achieved by simply clicking on the SyncDiscs iconbar icon.

Quit  –  will remove SyncDiscs from the iconbar and terminate the program.


The main control window

Screen shots of parts of the main control window are shown below.

main1.png - 21Kb

The top three writable fields can have directories dropped into them to provide the filing system paths to be used, or the paths can be typed in by hand.

Primary  –  The first field is 'Primary'. This is the main directory and is the directory that is to be 'backed up'.

Secondary  –  The second field is 'Secondary'. This is the directory which is to be changed, and is to be made the same as the Primary directory.

Scrap  –  The third field is 'Scrap' - any files which have to be deleted from the Secondary directory are moved here. If the scrap directory is left blank, then scrap files will simply be deleted. It is important to remember that the scrap directory should not be in either of the primary or secondary directories.

All three icons can contain more than one directory, separated by commas. In this case there must be the same number of directories in each. For example, if there are two directories in each, the first primary directory is backed up into the first secondary directory, and the second primary directory is backed up into the second secondary directory. To make this easier, if a directory is dragged into a field with SHIFT held down, a comma will be inserted at the end of the current contents of the field, and the new directory will be appended. If you are using scrap directories, then there must be the same number entered as for the primary and secondary directories, otherwise the scrap directory will be treated as blank and files will simply be deleted from the secondary directory.

Note that each of these fields is limited to a total number of characters of 255. Thus if you try and drop in several directories with long path names, this limit will be reached and unpredictable behaviour will ensue (directory names truncated or missing).

If CONTROL is held down, the directory leaf will have one element removed - this is useful if you want to enter the root directory of a disc.

If CONTROL and SHIFT are both held down when a directory is dropped onto the Secondary field, then the leaf name of the Primary directory will be added to the Secondary path. This can be useful when setting up the backup directories for the first time.

Hint: If you are using a scrap directory, then it is useful to have it on the same device as the secondary directory, especially if it is being accessed over a network. While a copy would normally load the data in to memory as an intermediate step, SyncDiscs tries to be a little more subtle, and attempts a 'delete existing scrap file/rename old secondary file to scrap' as a first step before resorting to a 'copy to scrap with force set'. The former is very much faster of course, but renames are only possible if the two filenames are on the same device.

Path conflicts. There are a number of directory pathname settings that would result in problems.

SyncDiscs will try to trap such occurrences and warn you.

In the next part of the window are three option buttons, and another writable field for the logfile path.

main2.png - 14Kb

The three option buttons control what happens if there are files in the secondary directory that are newer than, or not present, in the primary directory.

Copy newer files from secondary to primary  –  If ticked, any newer files which are found in the secondary directory will be copied back to the primary directory.

Copy extra files from secondary to primary  –  If ticked, extra files on the secondary will be copied back into the primary directory. Note that this option may result in the 77 files in a directory limit being breached if you are using a version of RISC OS prior to 4.0. This option should be used with care, since files deliberately deleted from the primary directory since the last synchronisation will be copied back into the primary directory, effectively undeleting them.

Overwrite newer files on secondary  –  If ticked, any files found on the secondary that are newer than the corresponding files in the primary directory will be replaced by the primary file even although it is older.

Logfile  –  SyncDiscs can create a file which contains a record of all the file operations carried out. The file will record all files copied, moved or deleted. The file path is set up either by typing it in manually, or by pressing the menu button to the right of the writable field and dragging the icon from the resultant Save As dialogue to your chosen destination. The logfile will only be used if the option button to the right of the menu button is ticked. See the section Additional settings for further options to control the log file. The button to the right (labelled Open) provides a quick means of opening the logfile in a text editor, but only if it has already been created. If the log path field is shaded, it means that the option 'Save log in primary' has been ticked in the Additional settings window.

Note that SyncDiscs will never attempt to copy the logfile if it happens to be within the primary directory, whether the logfile is active or not.

At the bottom of the window are action buttons to control its operation.

main3.png - 5Kb

Start  –  will start the synchronisation process.

Cancel  –  will simply close the main window.

Save  –  There are two distinct operations that can be carried out.

  1. Clicking on the Save button will save a default file containing all the settings as shown in the window. When SyncDiscs is run again, the current contents will be restored, allowing the same operation to be easily repeated.
  2. Clicking on the Menu button to the right of the Save button will raise a standard Save as dialogue. In this case all the current settings (in both the main SyncDisc window and the additional Settings window) will be saved as a Syncjob file. This file can be saved anywhere, and double clicking it (or dragging to the SyncDisc window or iconbar icon) will immediately start (or queue if a synchronisation is already in progress) the synchronisation job. This provides an easy way of repeating a regular backup requirement. Further information on using syncjob files is here.

Compare  –  The 'compare' button initiates a complete comparison of the primary and secondary paths, although no changes are made to any files. At the end of the process a text file is automatically opened which displays the results. In this file is listed all the differences between the contents of the two paths. It can be useful to do a compare after a synchronisation has finished - this picks up any inconsistencies in the copying process.

Settings...  –  This will open the Settings... dialogue, allowing a number of other preferences to be set (see below).


Additional settings

settings1.png -
30Kb

Multitask  –  When SyncDiscs is either comparing or synchronising two directories it can be run as a single-tasking or multi-tasking process. When single-tasking the machine is 'taken over' and cannot be used in any other way until the process has finished. If in multi-tasking mode, then SyncDiscs still polls the wimp during the processing and so the machine can be used for other purposes at the same time. Single tasking will be faster than multitasking.

Allow multiple filer action windows  –  This is only of relevance when operating in multitasking mode. Filer operations are passed on to the Filer_Action module, which also multitasks all its operations. If this option is unticked, then SyncDiscs will wait after initiating a filer action until it has completed. If multiple filer actions are allowed (by ticking this option) then SyncDiscs will continually launch filer actions in parallel, and not wait until any single one has completed. SyncDiscs will not allow too many filer actions to be active concurrently, since the desktop will become very unresponsive, so the number of filer actions active at the same time will be limited. The maximum number of concurrent filer actions can be set using the bump icons.

If you have configured for say ten Filer_Action windows, it does not mean there will always be ten running. It will depend upon how much data is to be copied, how large the files are and how fast the hardware is. Large files, such as digital images or audio files, or complete directories, take much longer to copy, and there is more chance that SyncDiscs will have started more off while earlier ones are still completing. Copying over a network will be much slower than copying between two hard drives on the same machine. However, you should not normally see more than the configured number at any one time.

Verbose filer actions  –  By default this is not ticked. If this is unticked, then when SyncDiscs invokes the Filer_Action module, it will do so with the verbose flag off. This means you will not normally see any Filer_Action dialogue boxes on the desktop. You will see the Filer_Action windows starting and stopping in the Task Manager listing of active application tasks (click SELECT on the right hand icon of the iconbar), and if you have the progress window open and maximised you will see the Filer_Action count displayed. This is the recommended option. If there occurs an error condition during a copy, you will then see the Filer_Action window with the error message and the buttons Skip, Retry etc. open.

If this option is ticked, then a filer_action window will always be opened for each filer_action started, showing the progress of the action. This may clutter the desktop, and will slow things down. The SyncDiscs progress window will give an indication of overall progress anyway.

Copy complete directories  –  By default this option is selected. If SyncDiscs finds a directory that does not exist in the backup, it will simply copy the whole directory as is, and not inspect the objects (files or directories) within it. This option is faster, but it means SyncDiscs does not see what is inside the directory, and cannot, for example, check whether files are open before copying, or whether one of the ignore zones (if being used) is contained within it. By unticking this option, SyncDiscs is forced to open up every subdirectory, recursively, and create each subdirectory and copy each individual file. For normal purposes, it is recommended that this option is ticked.

Timestamps equal if within...  –  One of the criteria used by SyncDiscs to determine whether to copy a file or not is to compare the date and time stamp of the two copies. A problem may arise here if you are backing up to a disc on a different OS because, while RISC OS stores timestamps to a precision of 1 centisecond, some other OSs use different precision, which could be better or worse than RISC OS. For example, if the precision is only 1 sec, as on some Windows file systems, then the timestamp of the copy will be rounded down to the nearest second. When SyncDiscs comes to do a subsequent backup, it may think the backup is older than it really is, and copy it again. To reduce this type of occurrence, when SyncDiscs compares the two timestamps, it can be made to ignore a small difference in timestamps and treat them as being equal. Tick this option to turn this behaviour on - the time difference can be set using the bump icons adjacent. A value of three seconds is a good compromise.

There is more information about time stamps here

Ignore filetype differences  –  SyncDiscs will normally copy a file if the filetypes of the primary and secondary copies are different. When copying to 'foreign' file systems using e.g. Fat32FS, the filetype mapping is controlled by the Mimemap file. Depending on the entries in this file, some filetypes may change when copied. For example, the zip filetype (&a91) may revert to archive (&ddc), or DOS filetype (&fe4) may revert to data or text filetype. This can cause unnecessary copy actions on subsequent synchronisations. If this option is ticked, then when SyncDiscs finds the only difference between the primary and secondary files is in the filetype, then the file will not be copied again.

The next part of the additional settings dialogue is concerned with log file management.

settings2.png
- 30Kb

New logfile each synchronisation session  –  By default, SyncDiscs will add all its output to the configured logfile, rather than starting a new one each synchronisation. This means the logfile can become very large over time (unless you periodically change the name or manually prune or delete it). If this option is ticked, then SyncDiscs will clear the logfile each time it carries out a synchronisation. Since older records are then lost, there is the further option to save the last few logs (up to 9). This is accomplished by adding a numerical suffix to the logfile name. When a synchronisation is started, the oldest logfile is deleted, and the rest are moved 'down the list' by renaming. Note that there may be a problem if the logfile name is of length ten characters on a filing system which does not support filenames longer than ten characters.

Note that a synchronisation session comprises the processing of a single queue of jobs, which may be a single, or a number of, job(s). The session ends when the last job in the queue has completed. It is at this point that the logfile will be written out to disc.

Auto-open log file on completion  –  This simply opens the logfile in the default text editor once the synchronisation is finished. If this is unticked, then the easiest way to open the log file is to reopen the main SyncDiscs window and click on the 'Open' button, situated to the right of the log file details. Note that, when a number of syncjobs are queued, the log file is opened only when the queue has been emptied.

Save logfile in primary directory  –  If this is ticked, then it will override the log file path in the main window, and SyncDiscs will then save a log file in the primary directory. When this option is ticked, the log path field in the main SyncDiscs window will be shaded. This is probably of most use when you frequently backup a lot of directories separately and you need to keep separate records of the backups. When this option is ticked the other log file settings described above are still honoured.

Verbose logging  –  If this is ticked, then if logging is enabled, more information will be written to the log file. It is recommended this option is unticked for normal use.

settings3.png
- 30Kb

Save  –  All the current settings can be saved by pressing this button. Note that SyncDiscs will always use the current settings when starting each synchronisation. When the settings are saved, then SyncDiscs will use the same ones when run on a future occasion.


Multitasking and the progress window

If SyncDiscs is configured for multitasking operation, then when either 'Start' or 'Compare' is clicked, the main SyncDiscs window will close, and a progress window will open instead. This is shown below.

status.png - 6Kb

The progress window shows the primary directory being copied, the operation being carried out, and the object being operated on. This will continuously update as the synchronisation or compare continues so you can convince yourself that things are happening. Note that the display will update only once a second when scanning through files, but will update immediately when files are being copied, etc.

If the top right icon (maximise/reduce) is clicked, then the progress window expands downwards. Below the fields described above, are two new fields. These show the number of filer actions in progress and the number of jobs waiting in the job queue. These fields update in real time.

At the bottom of the extended window are three action buttons.

status2.jpg - 21Kb

Pause  –  Clicking Pause will cause SyncDiscs to stop the processing and 'mark time'. The Pause button legend will change to 'Continue'. Pressing this will cause SyncDiscs to recommence processing files from the point it paused, and the continue button will change back into Pause.

status3.jpg - 23Kb

Stop  –  Clicking Stop will terminate the active synchronisation or compare process as soon as possible and all processing will stop. If there are more jobs remaining in the queue, a dialogue will be raised asking whether the remaining jobs should be skipped or not.

Note that any Filer_Actions which have already started when either pause or stop are clicked will continue to completion, but obviously no more will be started.

If it is necessary to stop the current filer-actions, then they can be stopped by going in to the Task Manager (click SELECT on the right hand icon of the iconbar) and click Menu over each filer-action and choose Quit. Quiting in this way may leave files or directories only partially copied. Partially copied files will probably be left with the data file type and are best deleted.

The close button closes the progress window, as does the close icon in the title bar. The progress window can be reopened by clicking on the SyncDiscs iconbar icon. However, if the compare or synchronisation process has already finished, then the main SyncDiscs window will be opened instead.

When the SyncDiscs process has completed, then clicking on the iconbar icon will open the main window again, closing the progress window at the same time. An alternative is to close the progress window with ADJUST, when the main window will be automatically reopened.


The Zone file

It is possible to have a text file called

!SyncDiscs.Resources.Zone

in which one can specify files that SyncDiscs should ignore when carrying out a synchronisation. One can match the left hand part of a path that you want to be ignored by SyncDiscs by using a pattern such as the following:

ADFS::HardDisc4.$.xxx

It is also possible to match the right hand side of paths by putting three dots before the file name. So

...tempfile

will make any file called 'tempfile' be ignored.

The facility is made more powerful by the use of wildcards in the zone file. The character * will match any number of characters, while the character ? will match one.

Putting all this together, for example, one can ignore all compiler object files, which are normally in directories named o, with a zone file entry of

...o.*

This feature should be considered developmental, since it only works if the individual objects are actually seen by the program. If, in the above example, the secondary has no 'o' directory, and the setting 'Copy complete directories' is ticked, then the o directory will be copied whole.

Note 1: If a file to be ignored is found to exist in the secondary, then that file will be deleted from the secondary.
Note 2: The zone file is read during program initiation. Therefore if you create or modify the zone file, !SyncDiscs must be restarted before the change will be recognised.


Command line

It is possible to call !SyncDiscs with some command line arguments. This is one method of automating the backup procedure. For example !SyncDiscs can be run from the !Alarm, or !Organizer applications. (See also the section on syncjob files for another method of automating backups)

The arguments are:

-quitMakes the program execute and then quit. If the parameter -quit is not used, then SyncDiscs will load to the iconbar with any parameters passed in the command line filled in to the main window. The synchronisation can then be started manually.
-primary <path> Set the primary path
-secondary <path> Set the secondary path
-scrap <path> Set the scrap path
 
-log <file> Set the log file name
~logTurn off logging
 
-extraCopy extra files from secondary to primary
~extraRemove extra files on secondary
 
-newerCopy newer files from secondary to primary
~newerDon't copy newer files from secondary to primary
 
-overOverwrite newer files on secondary
~overDon't copy older files from primary to secondary

Missing command line arguments default to the configured values. For example, if no -log argument is provided, the value previously saved from the main window is used.

Note that SyncDiscs will not multitask when started with command line arguments.


Precautions

When SyncDiscs is doing a synchronisation, it is copying, moving, and perhaps deleting files. Therefore anything that may interfere with these actions is to be avoided. Although the operating system should not carry out contradictory actions on a file at the same time, it may generate errors or error boxes, which must be dismissed before actions continue, or may terminate processes prematurely. None of these events are welcome in a process that may be left to run unattended. If SyncDiscs is being used in the multitasking environment, then there is even more scope for unwanted interactions.

When doing a backup, try to ensure that the directory(ies) involved do not contain any open files, and especially that any files are not likely to be accessed by other applications while the backup is taking place. Applications that should be avoided in particular are mail/news fetchers configured to automatically fetch and debatch periodically, for example, which do a lot of disc accesses during the fetching and debatching process.

Note that a number of applications keep files open while they are running. Some, like Netsurf, for example, keep a log file open at all times, into which debug information is written. With some applications, the !Run file is open whenever the application is running. This is due to there being commands in the !Run file after the line that launches the application. These commands are not run until after the application is quit, and so the !Run obey file is still active. One thing to watch for is the presence of additional line feeds at the end of a !Run file. These will cause the !Run file to be kept open until the application is quit, even although that is not necessary for the operation of the application. One or other of the utilities that list open files (e.g. !CloseFiles) is a useful application to run occasionally, to see what files are actually open.


Contact

All communication about SyncDiscs should now be directed to Chris Johnson (Email:chris@chris-johnson.org.uk). Suggestions for new features are always welcome.

Web sites

David Pilling's web site is at http://www.davidpilling.com/, in particular, the RISC OS section of the site is at http://www.davidpilling.com/riscos.html.

Chris Johnson's web site is at http://www.chris-johnson.org.uk/index.html, with his RISC OS software at http://www.chris-johnson.org.uk/software/index.html.


Screenshots

All the screen shots in these pages were obtained using Snapper, a versatile screen capture application.

Snapper is another utility originally by David Pilling, and is available from http://www.chris-johnson.org.uk/software/snap.html


These pages are best viewed in a CSS compliant browser. For RISC OS, Netsurf would be the browser of choice.

SyncDiscs is © 2012, Chris Johnson and David Pilling
Email:chris@chris-johnson.org.uk

This document last modified on 5th April 2014