Command Line Parameters

<< Click to Display Table of Contents >>

Navigation:  Using SyncBackPro > Technical Reference >

Command Line Parameters

 

A Definition of the Command Line

 

A Command Line is a space provided directly on the screen where users type specific commands. A CLI (command line interface) is a user interface to a computer's operating system or an application in which the user responds to a visual prompt by typing in a command on a specified line, receives a response back from the system, and then enters another command. The MS-DOS Prompt application in the Windows operating system is an example of the provision of a command line interface. Today, most users prefer the graphical user interface (GUI) offered by Windows or Macs.

 

 

SyncBackPro Installer Command Line Parameters

 

Note that the SyncBackPro installer also accepts command line parameters. See the Installing section for more details. Below, the parameters for SyncBackPro itself are explained.

 

 

SyncBackPro Command Line Parameters

 

SyncBackPro accepts a number of command line parameters. Some of these are used when SyncBackPro is called from the Windows Task Scheduler. Note that when SyncBackPro is run with command line parameters, by default it will run in Unattended mode and be minimized, which means that it will not prompt the user and will not be visible on screen.

 

-r: The profiles following this parameter are run in restore mode. By default profiles are run as backups/Synchronizations.

 

-i: The profiles following this parameter are run in interactive mode. By default profiles run from the command line are run unattended, i.e. no prompts are displayed. The opposite parameter is -silent

 

-m: Minimizes SyncBackPro. If you are running profiles then this is the default.

 

-n: The profiles following this parameter are run in normal mode, i.e. dialogs and windows are displayed on the screen. By default profiles run from the command line are run in minimized mode.

 

-p: The profiles following this parameter are run in parallel, i.e. they are all run at the same time. Normally the profiles are run in serial (one after the other).

 

-vgn [groupname]: The profiles following this parameter are run as part of the group (visual group). This is useful for when you have variables in a group and want to use them in the profile. The profile does not need to be part of the group and the group itself is not run. This is the same as running a profile that's in a group in the user interface.

 

-s: The profiles following this parameter are run in simulated mode, i.e. no files are actually copied or deleted.

 

-silent: The profiles following this parameter are run in unattended mode. By default profiles run from the command line are run unattended, i.e. no prompts are displayed. The opposite parameter is -i. The -silent parameter is useful when used in conjunction with the -export, -importprofile, -delete, and -log parameters.

 

-hibernate: Place the computer into hibernate mode (S4) (if the computer supports it).

 

-standby: Place the computer into a sleep state (if the computer supports it). What level of sleep state (S0 to S3) the device goes into is up to Windows and the level of hardware support.

 

-shutdown: Logoff, shutdown, and switch off the computer (if the computer supports it). SyncBackPro cannot guarantee that the computer will be shutdown. Windows does a shutdown asynchronously, meaning SyncBackPro can be told the computer will shutdown even though something could stop that shutdown, e.g. Windows itself, another application, a driver, a user, etc. If you do not have the access rights in Windows (e.g. you are not an administrator) then this command will fail.

 

-shutdownforce: Logoff, shutdown, and switch off the computer (if the computer supports it). Note that this will forcibly shutdown the computer, e.g. applications with unsaved data will be forcibly closed. SyncBackPro cannot guarantee that the computer will be shutdown. Windows does a shutdown asynchronously, meaning SyncBackPro can be told the computer will shutdown even though something could stop that shutdown, e.g. Windows itself, another application, a driver, a user, etc. If you do not have the access rights in Windows (e.g. you are not an administrator) then this command will fail.

 

-shutdownhybrid: This is the same as -shutdown, except on Windows 8 and newer systems it will perform a hybrid shutdown of the system. A hybrid shutdown prepares the system for a faster start-up.

 

-logoff: Logoff (logout) from the current Windows account. Keep in mind that it will logoff the user in the session it is run in. For example, a scheduled task will run in its own session if it's set to run if logged in or not. So the -logoff switch will not logoff the current user. If the scheduled task is set to run only if the user is logged in then it will logoff the current user.

 

-monoff: Switches off all attached display monitors. This is unlikely to work if the profile is run from a different session, e.g. run via the task scheduler.

 

-reboot: Reboot the computer (if the computer supports it). SyncBackPro cannot guarantee that the computer will be rebooted. Windows does a reboot asynchronously, meaning SyncBackPro can be told the computer will reboot even though something could stop the reboot, e.g. Windows itself, another application, a driver, a user, etc. If you do not have the access rights in Windows (e.g. you are not an administrator) then this command will fail.

 

-rebootforce: Reboot the computer (if the computer supports it). Note that this will forcibly reboot the computer, e.g. applications with unsaved data will be forcibly closed. SyncBackPro cannot guarantee that the computer will be rebooted. Windows does a reboot asynchronously, meaning SyncBackPro can be told the computer will reboot even though something could stop the reboot, e.g. Windows itself, another application, a driver, a user, etc. If you do not have the access rights in Windows (e.g. you are not an administrator) then this command will fail.

 

-rebootifreq: Reboot the computer (if the computer supports it) if a profile was run that required a reboot for a file to be replaced/deleted. If you do not have the access rights in Windows (e.g. you are not an administrator) then this command will fail.

 

-full: Perform a full backup, i.e. rescan the destination for changes. This is only for Fast Backup profiles.

 

-countdown [seconds]: When used this parameter will cause a small window appear with a countdown timer in it. For example, if you passed -countdown 10 then a window will appear counting down from 10 seconds. Once it reaches zero then the profiles following it in the command line will be run. You can abort the countdown (and exit the program) and so abort running of the profiles by clicking the Cancel button. If the user aborts the countdown then the exit code -100 is returned. If you click OK then the countdown is cleared and the program continues (and so the profiles are run). A countdown is also useful if you want to shutdown the computer after the profiles have run, but also want to abort the shutdown just in case you are using the computer at the time, e.g. -countdown 10 -shutdown. If you use this command line parameter in a scheduled task then make sure the -m parameter is not also used. If the task is scheduled then you must enable the checkbox "Run only when user is logged on" for the scheduled task otherwise the countdown window will not appear (this is due to the Windows security).

 

-countdownmsg [message] [seconds]: This is the same as the countdown parameter, except you can define what message you want to appear in the countdown window. If the user aborts the countdown then the exit code -100 is returned. Remember to wrap the message is double-quotes, e.g. -countdownmsg "Shutdown in 10 seconds" 10 -shutdown

 

-export [profile name] [filename]: This parameter is used to export a profile, or export all profiles. For example: -export "My Profile" "C:\Profiles\My Profile.sps" will export the profile called My Profile to the file C:\Profiles\My Profile.sps. To export all profiles you must use an asterisk for the profile name and supply a directory instead of a filename, e.g. -export * "C:\My Profiles" will export all profiles to the directory C:\My Profiles. The filenames will be the same as the profile names (with the .SPS filename extension). If a profile fails to be exported then the exit code -102 is returned. To not be prompted use the -silent parameter before -export

 

-importprofile [profile filename]: This parameter allows you to import many profiles by using wildcards. For example, -importprofile "C:\My Folder\*.sps", will import all the profiles from the "C:\My Folder\" folder. If no directory is given in the filename then the current directory is used. If it fails the exit code -101 is returned. To not be prompted use the -silent parameter before -importprofile

 

-importscript [script filename]: (sbpro-feature-16x16 Pro version only) This parameter allows you to import many scripts by using wildcards. For example, -importscript "C:\My Folder\*.sbs", will import all the scripts from the "C:\My Folder\" folder. If no directory is given in the filename then the current directory is used. For security reasons scripts are always imported interactively and with the users consent. See the note below for more details. If it fails the exit code -108 is returned.

 

-source: Set the source folder for all the following profiles to use. Variables can be used, but please see the important information at the end of the Variables section on how Windows expands environment variables. Also, if you are running a group then this source folder will be used with all the profiles in the group, and that may not be appropriate or desired. If you change the source folder then you should consider using the -noselect and -nofilter command line parameters.

 

-dest: Set the destination folder for all the following profiles to use. Variables can be used, but please see the important information at the end of the Variables section on how Windows expands environment variables.  Also, if you are running a group then this destination folder will be used with all the profiles in the group, and that may not be appropriate or desired. If you change the destination folder then you should consider using the -noselect and -nofilter command line parameters.

 

-noselect: This parameter will switch off the file & folder selections for the profiles being run. Aside from improving performance, it is also strongly advisable that the selections be switched off when the source or destination directories have been changed. See the Restoring and Selections section for more details.

 

-nofilter: This parameter will switch off the file & folder filters for the profiles being run. Aside from improving performance, it is also advisable that the filters be switched off when the source or destination directories have been changed. See the Restoring and Selections section for more details.

 

-nochanges: This parameter will run the profile but not allow the file or folder actions to be changed, or versions to be restored, if the Differences window is displayed (it will not be if unattended).

 

-nosplash: The splash screen will not be displayed.

 

-delete [profile name]: The named profile is deleted. If a profile fails to be deleted then the exit code -103 is returned. You may be prompted if the profile is password protected, for example. To not be prompted use the -silent parameter before -delete

 

-donotexit: By default SyncBack will automatically exit after performing the tasks given on the command line (that is unless the user interface is used while performing those tasks). To stop it exiting use this parameter.

 

-password [password]: When deleting or importing profiles, an existing profile may exist with that name and be password protected. Use this parameter to provide the password. The password parameter must come before the import filename or –delete parameter, e.g. –password “the password” –delete “profile name”.

 

-priority [priority]: The profiles following this on the command line will be run at this priority. 1 (Idle) is the lowest priority, and 7 (Time Critical) is the highest. The default is 4 (Normal). Note that this is the priority of the thread that runs the profile. It is not the priority of the entire SyncBack process (which is the priority that you'll see in the Windows Task Manager). To set the priority of the entire SyncBack process using the procpriority command line parameter. The SyncBack process can only have one priority but each thread can have its own priority. If you are also using -procpriority then you should specify that on the command line before -priority.

 

-procpriority [priority]: This sets the priority of the entire SyncBack process (which is the priority that you'll see in the Windows Task Manager). 1 (Idle) is the lowest priority, and 5 (High Priority) is the highest. The default is 3 (Normal). Although Windows supports it, real-time priority is not supported by SyncBack as it would do more harm than good. Note that the range of values, and default value, are different from that for the priority command line parameter. The SyncBack process can only have one priority but each thread can have its own priority.  If you are also using -priority then you should specify that on the command line after -procpriority.

 

warning

Giving SyncBackPro a lower priority means Windows will give less CPU time to SyncBackPro but that does not mean 100% of the CPU time will not be used. If there is spare CPU time, and a process needs to use the CPU, then it will be given CPU time. A lower priority means when CPU time is given to processes then the lower priority processes will get less of the CPU time when competing with higher priority processes.

 

-affinity [CPU mask]: This parameter is only of use on computers that are multi-core or multi-CPU and it must go on the command line before any profiles to be run. It ties the SyncBack process to one or more specific processors (or cores). This can be very useful if you want to limit the CPU resources SyncBack can use. The parameter is a bitmap mask (in decimal) with each bit representing a CPU. For example, to force SyncBack to only use processor 1 then pass 1, to force SyncBack to only use processor 2 then pass 2, to force SyncBack to use both processor 1 and 2 then pass 3, to force SyncBack to only use processor 3 then pass 4, etc. You can only specify processors/cores that exist and are also set to be used by the system.

 

-profaffinity [CPU mask]: This parameter sets the processor affinity for the profiles following this on the command line. If you are also using -affinity then that must go before -profaffinity on the command line, and it must go before any profiles to be run. If you use -affinity to set the affinity mask for the entire process then you can only use processors/cores that are in that mask. For example, if you specify -affinity 3 -profaffinity 1 profile1 -profaffinity profile2 then SyncBack (the entire process) is restricted to using processor/cores 1 and 2, profile1 will only use processor/core 1 and profile2 will only use processor/core2. If you specified -affinity 3 -profaffinity 4 profile1 then it would fail because processor/core 4 cannot be used by SyncBack.

 

-posreset: This will reset the positions of all windows. Note that you can perform the same action using the tray pop-up menu item Reset all window positions and sizes.

 

-noprofbackup: The profiles will not be backed up on exit.

 

-profbackup: The profiles will be backed up on exit.

 

-clearss: The Intelligent Synchronization data will be cleared for all profiles following it on the command line.

 

-log [profile name]: The latest log file for the profile will be displayed. If it is a group profile then the logs for all the profiles in the group will be displayed. If there is no log then an error message dialog is displayed. To stop the error message being displayed, use the -silent parameter before -log.

 

-sbmssync: (sbpro-feature-16x16 Pro version only) Using the defined connection parameters, it will login to the SBM Service, upload profile run history (if required), and download/delete the managed profiles (if required). If it fails the exit code -109 is returned.

 

-winpassword [password]: If you are importing profiles with a schedule then Windows may need your password in order to create the schedule (this is a security requirement of Windows). To avoid being prompted you can pass your Windows login password on the command line. If you do not give a password, and Windows needs your password, and you have not specified the -i parameter, then the schedule may silently fail to import.

 

-disable [profile name]: The specified profile will be disabled.

 

-enable [profile name]: The specified profile will be enabled.

 

-pause [profile name]: The specified profile will be paused.

 

-resume [profile name]: The specified profile will be resumed (if it is currently paused).

 

-settings [folder]: The specified folder will be used to get settings and profiles from. Note that unless you also use the parameter -restricted (see below) then it will also look in other folders for settings. Don't forget to use double-quotes around the folder name, e.g. -settings "C:\My Folder\". Also, it is not important where the setting is used on the command line. If you use the -settings parameter more than once then the last one is used. Note that you can also specify the folder to use during installation.

 

-restricted: This setting is used along with -settings to restrict SyncBackPro to only look for settings and profiles in that specific folder.

 

-debugon: Enabled debug output for the profiles run following it on the command line. See also -eventlog

 

-debugoff: Disables debug output, for the profiles run following it on the command line, when it was previously enabled using -debugon. This can only be used with -debugon. For example, if you had the following SyncBackPro profile1 -debugon profile2 -debugoff profile3, then debug output for profile1 would depend on the program settings for debug output. Debug output for profile2 would be enabled regardless of the program settings, and debug output for profile3 would depend on the program settings.

 

-eventlog: Enable debug output to the Windows Event Log. See also -debugon

 

-integcheck: (sbpro-feature-16x16 Pro version only) The profiles passed on the command line, following this parameter, are run as integrity checks. You can optionally choose which source/left and destination/right paths to check by using the -source and -dest parameters.

 

-copy [existing profile name] [copies profile name]: The specified profile will be copied and the new profile will be given the new name specified. If unattended then: any errors that occur will not be displayed, any existing profile will be replaced, the Fast Backup database will not be copied and neither will any Intelligent Sync database.

 

-donotshowlog: The log file will not be displayed after the profile runs.

 

-delay: If used, then SyncBackPro will immediately delay/pause for 5 seconds when it starts. This is useful when SyncBackPro is being started with Windows so that it doesn't overload the system on boot. You can use the command line parameter multiple times and it will stack, e.g. -delay -delay -delay will pause for 15 seconds. The parameter can be used anywhere on the command line, e.g. it does not need to be specified first or last, for example.

 

 

Running Profiles

 

All other parameters are assumed to be profile names. If a profile name has a space in it use double quotes around the profiles name, e.g. "All Profiles". The profile names are not case sensitive. So for example:

 

SyncBackPro profile1 -i profile2 profile3 -n -r "profile 4" -hibernate

 

This command will run profile1 as a backup/sync in unattended and minimized modes, profile2 and profile3 as a backup/sync in interactive and minimized modes, profile 4 as a restore in interactive and normal mode, and once all the profiles have finished the computer will hibernate.

 

If SyncBackPro is run with no command line parameters then it will first check to see if any other instances of SyncBackPro are running which also started with no command line parameters. If so, it will not start. This helps ensure only one instance of SyncBackPro is running.

 

However, whenever SyncBackPro is run with command line parameters, it will run regardless of whether any other instances of SyncBackPro are running or not. Also, if run with command line parameters, SyncBackPro will exit once it has finished its tasks, but if you use any part of its user interface while it is running then it will not exit.

 

 

Parameter Order

 

The command line parameters are evaluated from left to right (first to last). When a profile name is found then the profile is run using the settings before it. For example, if you want to change the source folder for a profile then you must specify that before the profile:

 

SyncBackPro -source "C:\New Source\" MyProfile

 

 

Importing Profiles

 

You can automatically import profiles by passing the filename of the exported profile on the command line. For example, if you exported a profile and saved it as 'MyProfile.SPS' then if you pass this on the command line to SyncBackPro it will automatically import the profile. The filename extension must be .SPS otherwise it is assumed to be the name of a profile to run. If you want to import multiple profiles using wildcards then you can use the -importprofile command line parameter. You can also import profiles by dragging the file onto the main window of SyncBackPro.

 

If a profile has a schedule then when you import it Windows may require you to provide your password (this is a security requirement of Windows). To avoid being prompted you can pass your Windows login password on the command line via the -winpassword command line parameter. If you do not give a password, and Windows needs your password, and you have not specified the -i parameter (so SyncBackPro cannot prompt you), then the schedule may silently fail to import.

 

 

Importing Scripts

 

You can also automatically import scripts by passing the filename of the exported script on the command line. The filename extension must be .SBS otherwise it is assumed to be the name of a profile to run. For security reasons scripts are always imported interactively and with the users consent. There is no way to bypass this. If you want to import multiple scripts using wildcards then you can use the -importscript command line parameter. You can also import scripts by dragging the file onto the main window of SyncBackPro.

 

 

Exit Codes

 

When running SyncBackPro from the command line, a batch file, etc. then it will return an exit code that gives an indication of whether the task was completed successfully or not. As a number of tasks can be done via the command line at the same time, e.g. import a profile, run it, then delete it, the exit code relates to the last task done on the command line. Also note that if a group profile is run then the exit code is undefined. In the list below, the second column, e.g. 0xFFFFFF97, is what the Windows Task Scheduler will show in the Last Result column.

 

0

 

Success, no error.

100

 

SyncBackPro did not close because of user interaction or the donotexit parameter was used

-100

0xFFFFFF9C

The countdown parameter was used and the user aborted it

-101

0xFFFFFF9B

An attempt was made to import a profile from the command line and it failed

-102

0xFFFFFF9A

The export parameter was used and a profile export failed

-103

0xFFFFFF99

The delete parameter was used and the profile failed to be deleted

-104

0xFFFFFF98

The user aborted the profile run

-105

0xFFFFFF97

The profile name given does not exist

-106

0xFFFFFF96

The profile was not run because it is disabled

-107

0xFFFFFF95

The profile run failed (note that the result of a group profile run is unknown)

-108

0xFFFFFF94

An attempt was made to import a script from the command line and it failed

-109

0xFFFFFF93

An attempt was made to synchronize with the SBM Service from the command line and it failed

-110

0xFFFFFF92

The SyncBackPro serial number is invalid or the evaluation period has expired

-111

0xFFFFFF91

SyncBackPro is being run from an external drive and there is no write access to the folder SyncBackPro is being run from

-112

0xFFFFFF90

An encryption key is being used but it cannot be loaded or is corrupt

-113

0xFFFFFF8F

The Ransomware Protection failed

 

 

 

All Content: 2BrightSparks Pte Ltd © 2003-2024