Creating File-Level Backup Job

To create a file-level backup job, use the following command:

veeamconfig job create filelevel --name <job_name> --reponame <repository_name> <objects> <advanced_options> <schedule_options> <active_full_backup_options> <indexing_options> --nosnap

where:

  • <job_name> — name for the created backup job.
  • <repository_name> — name of the backup repository that should be used as a target location for the backup job. The backup repository must be created in advance. To learn more, see Creating Backup Repository

If you want to create Veeam Agent backups in the Veeam backup repository, you should connect to the Veeam backup server in advance, before configuring the backup job. To learn more, see Connecting to Veeam Backup Server.

  • <indexing_options> — file system indexing options for the backup job. To learn more, see File System Indexing Settings.
  • --nosnap — option that instructs Veeam Agent for Linux to perform backup in the snapshot-less mode. With this option enabled, Veeam Agent for Linux will not create a snapshot of the backed-up volumes during backup. This allows Veeam Agent to back up data residing in file systems that are not supported for snapshot-based backup with Veeam Agent for Linux. Keep in mind that the snapshot-less file-level backup does not guarantee that data in the backup is consistent. To learn more, see Snapshot-Less File-Level Backup.

For example:

$ veeamconfig job create filelevel --name HomeFolderBackup --reponame NetworkRepository --includedirs /home/user --excludedirs /home/user/temp --excludemasks "*.pdf"

 

Creating File-Level Backup Job TIP

After you create the backup job, you can additionally configure the following backup job settings:

File Inclusion Options

When you create a file-level backup job, you must specify at least one directory that should be included in backup. If you do not want to back up some files and directories in the specified directory, you can exclude specific files and directories from backup.

IMPORTANT

Veeam Agent does not support backup of bind mount points. You must specify the path to the original mount point instead.

To define the backup scope for the file-level backup job, you can use the following command-line options:

Option

Description and values

--includedirs

Full path to a directory that should be included in backup, for example: /home/user.

You can specify one or several paths to directories in the computer file system. To separate several paths, use the ',' (comma) character, for example: /home/user/Documents,/home/user/reports.

Tip: If you want to back up the root directory and specify the '/' (slash) character, Veeam Agent will not automatically include the mount points in the backup scope. To include the mount points, you can do either of the following:

  • Enable automatic inclusion of local mount points when the root directory is added into the backup scope. To do this, in the Veeam Agent configuration file, enable the rootRecursion option and set it to true: rootRecursion = true.

Note that even if you enable this configuration option, network file systems will not be included into backup automatically; you will need to specify paths to such mount points manually.

  • Specify paths to the mount points manually.

For example, you have a network file system mounted to the /home/media directory. If you add '/' as an object to the backup scope, Veeam Agent will not back up the mounted network file system. To back up the root directory and the mounted network file system, add the following objects to the backup scope: /,/home/media.

--excludedirs

Full path to a directory that should be excluded from backup. The directory specified with this option must be a subdirectory of the directory specified with the --includedirs option. To separate several paths, use the ',' (comma) character, for example, /home/user/Documents,/home/user/reports.

--includemasks

A name mask for the files that should be included in the backup. You can use the following UNIX wildcard characters for file name masks:

  • '*' — a substitution for one or more characters in the file name. Can be used for any sequence of characters (including no characters). For example, *.pdf.
  • '?' — a substitution of one character in the file name. For example, repor?.pdf.
  • '[]' — a substitution of one character in the file name with any of the characters enclosed in square brackets (or a range of characters defined with the '-' character). For example: report_201[3456].pdf or report_201[3-6].pdf.

Keep in mind that you must specify each name mask in double quotation marks (""). For example: --includemasks "*.bak".

If you want to use several file name masks, you must specify them in double quotation marks ("") and separate them with a comma (,). For example: --includemasks "*.bak,*.pdf".

File inclusion option is applied to all directories that are specified with the --includedirs option. For example, if you include in backup the /home/user/Documents directory and files that match the repor?.pdf file name mask, Veeam Agent for Linux will back up the /home/user/Documents/report.pdf file and will not back up the /home/user/reports/report.pdf file.

--excludemasks

A name mask for the files that should be excluded from the backup. You can use the following UNIX wildcard characters for file name masks:

  • '*' — a substitution for one or more characters in the file name. Can be used for any sequence of characters (including no characters). For example, *.pdf.
  • '?' — a substitution of one character in the file name. For example, repor?.pdf.
  • '[]' — a substitution of one character in the file name with any of the characters enclosed in square brackets (or a range of characters defined with the '-' character). For example: report_201[3456].pdf or report_201[3-6].pdf.

Keep in mind that you must specify each name mask in double quotation marks (""). For example: --excludemasks "*.bak".

If you want to use several file name masks, you must specify them in double quotation marks ("") and separate them with a comma (,). For example: --excludemasks *.bak,*.pdf".

File exclusion option is applied to all directories that are specified with the --includedirs option and files that match file name masks specified with the --includemasks option. For example, you may want to specify the following backup scope for the backup job:

  • Include in backup the /home/user/Documents directory
  • Include files that match the report.* file name mask
  • Exclude files that match the *.odt file name mask.

In this case, Veeam Agent for Linux will back up the /home/user/Documents/report.pdf file and will not back up /home/user/Documents/report.odt and /home/user/reports/report.pdf files.

 

Advanced Backup Job Settings

You can specify the following advanced options for the backup job:

Option

Description and values

--compressionlevel

Data compression level. Possible values are:

  • 0 — No compression
  • 1 — Rle
  • 2 — Lz4
  • 3 — Zstd 3
  • 4 — Zstd 9

--blocksize

Data block size in kilobytes. Possible values are 256, 512, 1024, 4096 or 8192.

The default value is 1024.

--maxpoints

The number of restore points that you want to store in the backup location. By default, Veeam Agent for Linux keeps 7 latest restore points. When the new restore point that exceeds the specified number is created, Veeam Agent for Linux will remove the earliest restore point from the backup chain.

--immutabledays

The time period in days during which the backup stored in an object storage repository will be immutable to modification or deletion. For more information, see Backup Immutability.

--prefreeze

Path to the pre-freeze script that should be executed before the snapshot creation.

This option is available only if Veeam Agent for Linux operates in the Server edition. To learn about editions, see Product Editions.

--postthaw

Path to the post-thaw script that should be executed after the snapshot creation.

This option is available only if Veeam Agent for Linux operates in the Server edition. To learn about editions, see Product Editions.

--prejob

Path to the script that should be executed at the start of the backup job.

--postjob

Path to the script that should be executed after the backup job completes.

--setencryption

Defines that data encryption option is enabled for the job. When you use the veeamconfig job create command with the --setencryption option, Veeam Agent for Linux will prompt you to specify a password for data encryption and hint for the password.

--deleteold

The number of days to keep the backup created with the backup job in the target location. If Veeam Agent for Linux does not create new restore points for the backup, the backup will remain in the target location for the specified number of days. When this period is over, the backup will be removed from the target location. Possible values are: 1–999.

If you do not specify the --deleteold option, Veeam Agent will not apply this setting. The backup will be stored in the target location until you delete it manually.

 

Schedule Settings

If you use Veeam Agent version 6.0, you can specify schedule options for the backup job to create backups daily or on specific weekdays at specific time. Starting from version 6.1, you can also configure more flexible monthly and periodic schedules by using the following options: --weeknumber, --monthlyweekday, --months and --every.

Option

Description and values

--weekdays

[For weekly schedules] Specifies the weekdays when the backup job must run. If you want to run the backup job more than once during the week, the list of weekdays must be separated by a comma (','). Possible values are:

  • Mon — Monday
  • Tue — Tuesday
  • Wed — Wednesday
  • Thu — Thursday
  • Fri — Friday
  • Sat — Saturday
  • Sun — Sunday

--daily

[For weekly schedules] Defines that the backup job must start daily at specific time.

--thisday

[For monthly schedules] Specifies the day of the month when the backup job must run. Possible values: from 1 to 31 or Last.

--weeknumber

[For monthly schedules] Specifies the week of the month when the backup job must run. Possible values: First, Second, Third, Fourth or Last. This option must be used in combination with the --monthlyweekday option.

--monthlyweekday

[For monthly schedules] Specifies the day of the week when the backup job must run. You can select only one weekday. Possible values are:

  • Mon — Monday
  • Tue — Tuesday
  • Wed — Wednesday
  • Thu — Thursday
  • Fri — Friday
  • Sat — Saturday
  • Sun — Sunday

--months

[For monthly schedules] Specifies the months when the backup job must run. If you specify more than one month, the list must be separated by a comma (,) — for example: Jan,Apr,Jul,Oct. If you do not specify this option, the backup job will run every month.

--every

[For periodic schedules] Specifies the period of time in minutes or hours between the runs of the backup job. The period must be specified in the HH: MM format — for example, 06:00.

--at

[For weekly and monthly schedules]  Specifies the time of day in the HH:MM format when the backup job must start — for example: 20:00.

After the backup job is created, Veeam Agent for Linux automatically enables backup schedule. To learn about how to configure backup schedule for an existing backup job, see Configuring Backup Schedule.

Active Full Backup Schedule Settings

You can specify schedule options for the backup job to create active full backups on specific weekdays or days of the month.

If you use Veeam Agent version 6.0, you can specify schedule options for the backup job to create active full backups on specific days of the week or month. Starting from version 6.1, you can also configure more flexible monthly schedules for active full backups by using the following options: --weeknumber-full, --monthlyweekday-full and --months-full.

Option

Description and values

--weekdays-full

[For weekly schedules] Specifies the weekdays when the backup job must create an active full backup. If you want to create an active full backup more than once during the week, the list of weekdays must be separated by a comma (','). Possible values are:

  • Mon — Monday
  • Tue — Tuesday
  • Wed — Wednesday
  • Thu — Thursday
  • Fri — Friday
  • Sat — Saturday
  • Sun — Sunday

--thisday-full

[For monthly schedules] Specifies the day of the month when the backup job must create an active full backup. Possible values: from 1 to 31 or Last.

--weeknumber-full

[For monthly schedules] Specifies the week of the month when the backup jobmust create an active full backup.. Possible values: First, Second, Third, Fourth or Last. This option must be used in combination with the --monthlyweekday option.

--monthlyweekday-full

[For monthly schedules] Specifies the day of the week when the backup job must create an active full backup. You can select only one weekday. Possible values are:

  • Mon — Monday
  • Tue — Tuesday
  • Wed — Wednesday
  • Thu — Thursday
  • Fri — Friday
  • Sat — Saturday
  • Sun — Sunday

--months-full

[For monthly schedules] Specifies the months when the backup job must create an active full backup. If you specify more than one month, the list must be separated by a comma (,) — for example: Jan,Apr,Jul,Oct. If you do not specify this option, the backup job will create an active full backup. every month.

After the backup job is created, Veeam Agent automatically enables active full backup schedule. To learn about how to configure active full backup schedule for an existing backup job, see Configuring Active Full Backup Schedule.

File System Indexing Settings

You can specify the following file system indexing option for the backup job:

Option

Description and values

--indexall

Defines that Veeam Agent for Linux must index all files in the directories included in backup.

 

To learn more about file indexing, see File System Indexing.