contents
PersBackup

Personal Backup

© 2001 − 2021, Dr. J. Rathlev

Command line options

Having started the program via a desktop shortcut, a batch script or having invoked it from another program (e.g. Windows Task Scheduler), you can control it by using the following command line options (note: all options can be abbreviated but must be distinct: e.g. /force = /f = /for):

Overview

/auto /backupdir /clean /directory /disable /edit
/elevate /erractions /end /force /hide /ini
/lang /logmode /logdir /mode /noaction /nosound
/parallel /portable /prompt /quiet /repldrive /restore
/reset /showlog /speed /status /stay /suspend
/taskdir /tempdir /timeslot /user /verify /wait
/zipname
Placeholders Control file Exit codes

Description

Note: Parameters enclosed in square brackets are variable:
e.g. /timeslot:[Value] can be replaced by /timeslot:2011521, log:[Value] by /log:2 or /end:[Option] by end:shutdown.

none:
The program will start with its normal desktop window.
 
@[OptionFile]
The command line options are loaded from the control file [OptionFile] (see below). If [OptionFile] does not contain a full path, it must be in the installation path of the program.
 
[TaskFile]:
The user will be prompted for the designated operation for the backup task [TaskFile] (see here): The file [TaskFile] may contain a path or a placeholder. If the full path is not specified, the file will be searched for in the default task directory (refer to Preferences > Directories in the control panel menu).
 
[TaskFile] /edit
Unlike the description above, no selection dialog will be displayed. Instead the specified task will be immediately opened for editing. If no backup task is specified, a new task will be created.
 
/reset
The main window will be reset to its default position and size. Optional a new task will be created. This option is useful if the program window remains invisible after starting because it lies beyond the current screen or if the program hangs when attempting to load the selected task file.
 
/auto:
Starts automatic backup. When you have activated at least one automatic backup or checked the option Show icon in notification area, a shortcut using the /auto option is inserted by the program into your Windows Startup folder accessible via Windows + Rshell:startup.
Personal Backup will be started automatically when the user logs on and will check if any automatic backups are registered. Tasks to be executed after logon will be started immediately. If more tasks are pending on the same day (e.g. at a fixed time or on logoff), the program will be remain running in the background and a small icon is displayed in the Windows notification area. Otherwise the program will be closed.
 
/stay:
This option will only work in connection with /auto. If specified in the command line, the program will remain running in the background even if no more backups are pending on the same day.
 
#[n] /force:
Using this option, backups configured for automatic execution can be started unscheduled.
#: Will immediately start all activated backups.
#0: Will immediately start all backups selected as By request.
#n: Will immediately start the backup from the list of automatic backups matching the specified number n, e.g. #1 /force.
Unless specified otherwise in the command line (e.g. by /prompt:error for the status window), the settings of the automatic backup will be assumed.
 
[Filelist] /force:
Starts a backup of all tasks specified in the list of files (important note). The backups will run one after another in the given order. The filenames may contain a placeholder. The default extension (buj) is appended automatically.
The option "[Filelist] /force" is very useful in connection with Windows Task Scheduler, in that it is possible to execute several backup tasks at preset times.
Example: PersBackup.exe C:\Backup\BackupA.buj C:\Backup\BackupB.buj /force
 
/parallel
This option will only work in connection with /force and if a file list containing more than one backup task is specified. These will be started in parallel and run simultaneously. Without this option, the backup tasks will be started one after another (see above). A subsequent action, like shutdown or transferring into standby, will be executed not before all backups have finished.
 
[Filelist] /restore:
The Restore tasks specified in [Filelist] (e.g. Rest-1 Rest-2, important note) will be started. The filenames may contain a placeholder. The default file extension (rsj) is appended automatically. Prior to this, you must have configured and saved the Restore tasks (see Restore data from backup).
 
[Filelist] /clean:
The Cleanup tasks specified in [Filelist] (e.g. Clean-1 Clean-2, important note) will be started. The filenames may contain a placeholder. The default file extension (cuj) is appended automatically. Prior to this, you must have configured and saved the Cleanup tasks (see Clean up the backup directory).
 
[Filelist] /verify:
The Verify tasks specified in [Filelist] (e.g. Verify-1 Verify-2, important note) will be started. The filenames may contain a placeholder. The default file extension (vfj) is appended automatically. Prior to this, you must have configured and saved the Verify tasks (see Verification of backed up files).
 
/timeslot:[Value]
Value specifies a time slot. Only matching files will be backed up. By default, the modified timestamp is used for comparison. Optional the creation time stamp can be selected by a preceding c.
yyyymmdd
Only files changed on the specified date will be backed up (e.g. /timeslot:2011521 = 21 May 2011).
yyyymmdd-yyyymmdd
Only files changed between the specified dates will be backed up (e.g. /timeslot:20100521-20110315 = May 21. 2010 00:00 - 15 March 2011 24:00).
+yyyymmdd
Only files changed after the specified date will be backed up (e.g. /timeslot:+20110521 = since May 21. 2011 00:00).
-yyyymmdd
Only files changed before the specified date will be backed up (e.g. /timeslot:-20110521 = before May 21. 2011 24:00).
thhnn
Only files changed after the specified time on the current day will be backed up (e.g. /timeslot:t0835 = today after 08:35).
ox
Only files changed more than x days ago will be backed up (e.g. /timeslot:d14 = older than 14 days).
dx
Only files changed within the last x days will be backed up (e.g. /timeslot:d14 = within last 14 days).
u
Only those files will be backed up that have changed or were newly-created since last backup of the specified task.
q
When the backup starts, a dialog window will be displayed in which an individual time slot (e.g. /timeslot:q) can be set.
c...
If one of the above options is preceded with c, the creation timestamp will be used for comparison instead of the modified timestamp (e.g. /timeslot:c+20110521 = files created since May 21. 2011 00:00)).
Note: yyyy = year, mm = month, dd = day, hh = hours, nn = minutes, x = number of days
 
/end:[Option]:
Defines which action is to be carried out after running the tasks specified in the command line (see above):
shutdown
After completing the tasks, the system will be shut down and the computer switched off. This will even function if the user executing the program is not logged on interactively (e.g. on locked screen).
Example of use: If you often wish to carry out a backup before shutting down your computer, create a shortcut on your desktop using this command line option. To back up and shut down, double-click this shortcut (see here).
lockdown
The function is the same as shutdown, but the lock screen will be enabled immediately to preclude access to the computer by unauthorized persons.
idleoff
The function is the same as shutdown, but the computer will only be shut down if no user is logged on interactively at all.
This option only makes sense if used in a command line to start the backup from the Windows Task Scheduler because this can be done without having a user logged on. The computer will only be shut down after the backup if in the meantime no user has logged on.
poweroff
After completing the tasks, the system will be shut down and the computer switched off. This will only function if the user executing the program is logged on interactively.
hybrid
After completing the tasks, the system will be shut down and the computer will be put into hybrid sleep mode (available since Windows 8). This will only function if the user executing the program is logged on interactively.
restart
After completing the tasks, the system will be shut down as using the option /shutdown and then restarted automatically.
logoff
This option is similar to /poweroff, but just logs the current user off once the backup is completed.
Notes:
  1. You can omit /force in connection with /end:[Option].
  2. During the backup, the selected option will be displayed in the status window and can be changed there by the user. This can be prevented by using the additional command line option /noaction (see below).
 
/suspend:[Option]
Puts the system into suspension after Backup, Restore or Cleanup (see above):
standby
The system is put into standby mode: data remains in RAM but is not saved. In this mode, system wake up is quick, but data will be lost on power failure.
hibernate
The system is put into hibernate mode: RAM data is saved to disk. In this mode, system wake up takes longer, but no data will be lost on power failure.
Notes:
  1. A requirement for a password on wake up can be set via Power Options in Control Panel.
  2. During the backup, the selected option will be displayed in the status window and can be changed there by the user. This can be prevented by using the additional command line option /noaction (see below).
 
/erractions:[Option]
Use this option to specify whether an intended action (/end:[Option] or /suspend:[Option]) will also be carried out if an error occurred during backup. [Option] is a value between 0 and 31 whereas the following options can be combined in any way:
0 The action will be carried out under all circumstances (as if no option is specified)
1 The action will not be carried out if the task file is not found
2 The action will not be carried out if the destination is not accessible
4 The action will not be carried out if the source directory is not found
8 The action will not be carried out if the task configuration is invalid
16 The action will not be carried out if any other error occurred during backup (e.g. an error on copying a file)
To combine the options, just add the above values, for example 1+4+16=21 (/erractions:21) would avoid a shutdown if the task file or the source directory is not found or another error occurred during backup.
 
/noaction
If this option is specified, the user cannot select another action during backup to be performed afterwards (e.g. power off or standby: see more here).
 
/prompt:[Option]
Defines how dialog and status windows are displayed during backup. The settings are similar to those for automatic backups.
wait Wait for user prompt.
delay Close status window after a short delay (default).
error User prompt will be required on errors. Otherwise the window will be closed after a delay.
quiet Display no progress and status windows (see /quiet).
silent Display no progress window, status window only on errors.
 
/quiet
Starts the backup as a background task. No progress window is displayed. To inform you that a backup task is running, an animated icon appears in the notification area. You can click this icon to check progress.
 
/hide
Suppress the splash screen on startup.
 
/nosound
No sounds are played, e.g. at the end of a backup.
 
/status:[Option]
Defines how the status window showing the progress and outcome of the current action (e.g. Backup) will be displayed on the desktop.
normal The status window will be displayed in the foreground after starting the action. If another applications is activated, it is moved to the background until the user reactivates the program by clicking the task bar button or has to respond to a user prompt.
behind The status window will remain in the background until the user reactivates the program by clicking the task bar button or has to respond to a user prompt.
ontop The status window will always be displayed in front of all other applications.
 
/speed:[Option]
Defines the priority of the file copying processes with respect to other applications.
fast File copying is carried out using a higher priority than normal.
slow File copying is carried out using a lower priority than normal.
 
/elevate
When using this option, on program start the Windows User Access Control will prompt for an elevation of user privileges. This is for example required to use Volume Shadow Copies.
 
/user:[Name]:[Password]
If using a backup destination on a network drive that requires a different user account, you can specify the name and password of this user.
 
/ini:[Filename] or /ini:[Directory]
The user configuration (amongst others the settings for automatic backups) is saved in the file PersBackup.ini. This file is located by default in the Application Data directory of the user: Using this option you can select an alternative configuration file in the default directory (e.g. /ini:pb.ini ) or at any other location. For this, a full path must be specified (e.g. E:\MyBackupConfiguration\Backup-1.ini). If only a directory is given, the default name PersBackup.ini will be added automatically.
The log files are located in the same directory (using the second example: E:\MyBackupConfiguration\Backup-1.log). If Filename contains a full path, the file holding the settings for the selected language and the program updates (PersBack.cfg) will also be saved in this directory (e.g. E:\MyBackupConfiguration\PersBack.cfg). Filename may contain a placeholder.
 
/taskdir:[Directory]
Directory specifies a special path to the task files. This replaces the default path in My Documents. When starting the program from a USB stick, for example, you should use this option together with /ini:.. to save the task files by default on the stick. The filename may contain a placeholder.
Example: persbackup.exe /i:%progpath%\pb5-1.ini /t:%progpath%
 
/portable
Using this option, Personal Backup will be started in a way that no traces will be left behind on the PC. This is for example recommended if a backup is to be executed from a USB stick. First, copy all files from the program directory (usually C:\Program Files\Personal Backup 6) or the downloadable zip file to a directory on the USB drive (e.g. K:\PersBack). If you were now start the program PersBackup.exe from there, all program settings, the backup tasks and the log files would be saved in several subdirectories of the logged on user (see more). Using the option /portable will cause all these files to be redirected to the directory on the USB stick from where the program was started. Using the example given above, the following locations would be used for an installation in K:\PersBack : To start the program with this option, you can use a batch file or a shortcut containing this line
K:\PersBack\PersBackup.exe /portable
To install the program on an external drive, it is recommended to use the provided zip file.
 
/zipname:[Name]
When backing up into zip files, Name is used for the zip files instead of the name defined in the task.
 
/dir:[Directory]
With this option, a backup of the directory Directory will immediately be started. For this, the settings for the first directory to be saved from the task specified in the command line are used. If no task is specified, the settings from the task selected as the default backup task are used. If no such task has been selected, the user will be prompted to select an appropriate task for this purpose
 
/backupdir:[Directory]
If Directory is a full path (e.g. G:\Backup), it will be used instead of the destination path defined in the task.
If it is a relative path (e.g. Test\Diff), an additional subdirectory will be created beneath the destination folder defined in the task, hence it is possible to configure backup schedules using Windows Task Scheduler. This option is used by the program addon PbPlaner.
 
/mode:[full|diff|incr]
This option overrides the settings of the specified backup task and carries out a full, differential or incremental backup within a backup schedule.
 
/repldrive:<Dr>=<UNC-Path>
This option will replace with a UNC path the drive specification in source paths. The purpose is to have access to the snapshot created by the program Volume Shadow Copy Simple Client for backup.
Example for use in a batch file: Persbackup.exe /repldrive:C=%1 (example)
 
/lang:[xx]
Select the user language. The command line option overrides the setting from the control panel menu (Language).
xx = de German   xx = it Italian   xx = nl Dutch   xx = ru Russian
xx = en English   xx = es Spanish   xx = hu Hungarian
xx = fr French   xx = pt Portuguese   xx = pl Polish
 
/logmode:[n]
This setting overrides the log file settings from the task. The value [n] specifies the log type:
0 No log
1 Short log
2 Long log
3 Verbose log (for debugging purposes)
11, 12 and 13 Short, long or verbose log. An existing log file will be deleted before.
 
/logdir:[Directory]
Directory specifies a special directory for the backup logs. If no full path is specified, a new subdirectory Directory will be created relative to the task directory (default location for log files see above).
 
/showlog
[Logname] /showlog
Either the program default log or the specified log file will be displayed.
 
/tempdir:[Directory]
Directory specifies a special directory for the temporary files. If no full path is specified, a new subdirectory Directory will be created relative to the task directory (default location for temporary files see here).
 
/wait:[n]
When a backup has been completed, a status window is displayed for a short, preset time (see Preferences ⇒ View in the control panel menu). With this option, the preset time can be set also in the command line (e.g. with tasks to be carried out immediately, using /force). The value of [n] is entered in seconds, with the value 0 meaning that the status window must be closed by the user.
 
/disable
No entry is created in the Windows Startup folder accessible via the Start menu.
 
 

Important note: The filenames must be separated by a spaces. If a filename or file path contains spaces, it must be enclosed by quotation marks.


Examples:

1. Start backup task (Filename: B-Task1.buj):
Command line: "%ProgramFiles%\Personal Backup 6\Persbackup.exe" B-Task1 /force
2. Start backup task and shut down: (Filename: B-Task2.buj):
Command line: "%ProgramFiles%\Personal Backup 6\Persbackup.exe" B-Task2 /end:poweroff
3. Start cleanup task (Filename: L-Task.cuj):
Command line: "%ProgramFiles%\Personal Backup 6\Persbackup.exe" L-Task /clean

Placeholders for paths

You can use the following placeholders in the command line (all paths refer to Windows 7):

    * only available on 64-bit systems

Examples:

for Ini-File in C:\Program Files\Personal Backup 6:
Command line: "%ProgramFiles%\Personal Backup 6\Persbackup.exe" "/i:%progpath%\pb.ini"
for task in C:\Users\<username>\Documents\PersBackup:
Command line: "%ProgramFiles%\Personal Backup 6\Persbackup.exe" /i:%perspath%\PersBackup\backup-1

Note:
When using placeholders in a batch file the "%" characters must be duplicated (e.g. .. /i:%%progpath%%\pb.ini


Control file:

You can write all options line by line to a file instead of to the command line itself: each line must contain one option or filename. All text behind a semicolon is handled as comment. Do not use quotation marks on paths containing spaces.

Example: (referring to Windows 7)

/ini:C:\Program Files\Personal Backup 6\pb61.ini ; alternate ini file
/logmode:2 ;create long log
/wait:1
/hide
/quiet
/force
; Backup tasks:
C:\PersonalBackup\backup-1.buj
C:\PersonalBackup\backup-2.buj

Exit codes

Starting Personal Backup using the command line with one of the options /force, /restore or /clean will deliver an ExitCode to the calling application on termination. In a batch file this can be retrieved using the variable ErrorLevel. The following values are used:

  0 No error
  1 Task file not found
  2 Destination not accessible
  3 Source directory not found
  4 Other error (e.g. error on copying files)
  5 Canceled by user
  6 Invalid task configuration

J. Rathlev, 24222 Schwentinental, Germany, August 2020