contents
PersBackup

Personal Backup Version 5.9

© 2001 − 2018, Dr. J. Rathlev

Command line options

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

Overview

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

Description

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]: 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 main menu).
 
[TaskFile] /edit
Unlike the description above, no selection dialog will be displayed. Instead the specified task will be immediately opened for editing.
 
/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:
Immediately starts all (# /force) or one (e.g. #1 /force, task no. 1) of those tasks configured for automatic backup. 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
 
[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]
This option was renamed in version 5.9. The previous option /gap:[Value] is still working.
Value specifies a time slot for the files to be backed up:
yyyymmdd
Only files changed on the specified date will be backed up (e.g. /gap:2011521 = 21 May 2011).
yyyymmdd-yyyymmdd
Only files changed between the specified dates will be backed up (e.g. /gap:20100521-20110315 = 21 May 2010 00:00 - 15 March 2011 24:00).
+yyyymmdd
Only files changed after the specified date will be backed up (e.g. /gap:+20110521 = after 21 May 2011 00:00).
-yyyymmdd
Only files changed before the specified date will be backed up (e.g. /gap:-20110521 = before 21 May 2011 24:00).
thhnn
Only files changed after the specified time on the current day will be backed up (e.g. /gap:t0835 = today after 08:35).
ox
Only files changed more than x days ago will be backed up (e.g. /gap:d14 = older than 14 days).
dx
Only files changed within the last x days will be backed up (e.g. /gap: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. /gap:q) can be set.
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):
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.
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.
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).
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.
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.
logoff
This option is similar to /poweroff, but just logs the current user off once the backup is completed.
restart
After completing the tasks, the system will be shut down and restarted automatically.
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).
 
/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 5) 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 main menu (Preferences ⇒ 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
 
/log:[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 main 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.
 
/narrow
The program will start in a narrow window without the toolbar (left) and without options for automatic backup (right). This is useful if for service purposes only a reduced screen resolution is available. You can switch to the normal window using Preferences ⇒ View in the main 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 5\Persbackup.exe" B-Task1 /force
2. Start backup task and shut down: (Filename: B-Task2.buj):
Command line: "%ProgramFiles%\Personal Backup 5\Persbackup.exe" B-Task2 /end:poweroff
3. Start cleanup task (Filename: L-Task.cuj):
Command line: "%ProgramFiles%\Personal Backup 5\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 5:
Command line: "%ProgramFiles%\Personal Backup 5\Persbackup.exe" /i:%progpath%\pb.ini
for task in C:\Users\<username>\Documents\PersBackup:
Command line: "%ProgramFiles%\Personal Backup 5\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 5\pb5-1.ini
/log:2 ;create long log
/wait:1
/hide
/quiet
/force
; Backup tasks: C:\Program Files\Personal Backup 5\backup-1.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, September 2018