Skip to content
Smarter by Design.Simpler for Business

sys-cmd file ​

sys-cmd file is the command that manages, in WEB-CLI, the temporary file area in which the files produced by the system commands are kept. In this area there are the outputs written with | to-file, the tcpdump captures, the support bundles produced with support collect and the packet capture records taken from the management interface. The files are listed, a download link is taken, their contents are shown and they are deleted; the disk size of the area is also viewed and changed from here.

Command Summary ​

TR7 WEB-CLI · sys-cmd file
# type file and press Tab
admin@TR7LBWAF01> sys-cmd file
clean  content  delete  disk  list  show
 
admin@TR7LBWAF01> sys-cmd file list
admin@TR7LBWAF01> sys-cmd file show <file-name>
admin@TR7LBWAF01> sys-cmd file content <file-name>
admin@TR7LBWAF01> sys-cmd file delete <file-name> <file-name> …
admin@TR7LBWAF01> sys-cmd file clean
admin@TR7LBWAF01> sys-cmd file disk show
admin@TR7LBWAF01> sys-cmd file disk change-size <size>
admin@TR7LBWAF01>  

In the show, content and delete commands the file name is written directly, without a field name; Tab suggests the files in the area. In the change-size command the size is also written directly.

The list, clean and disk show commands have no field; the order of the mandatory values is given in the table in each command's own section.

How It Works ​

SubjectBehavior
ContextIt is not affected by the selected v-device and route table; it always runs in the temporary file area of the device.
File namesThe name of the file written with to-file contains only letters, digits, -, _ and .. A name that contains .. or a directory separator is rejected: Invalid filename.
DownloadingThe address in the Link column downloads the file; every download is written to the user logs as "<file>" name CLI file downloaded.
PersistenceThe files stay in the area until they are deleted with file delete or file clean. The only exception is the support bundles: while a new bundle is being produced, the ones other than the newest are deleted by themselves.
RecordingEvery run is written to the user logs.

sys-cmd file list ​

It shows all the files in the area in a table sorted by name. It does not ask for confirmation and does not change anything.

ColumnContent
FilenameThe name of the file
File sizeThe size with a readable unit
Last modifiedIn the YYYY-MM-DD HH:MM:ss format
LinkThe address that downloads the file
TR7 WEB-CLI · file list
admin@TR7LBWAF01> sys-cmd file list
admin@TR7LBWAF01>  

sys-cmd file show ​

It shows the row of a single file with the same columns as file list; it does not print the content to the screen. It is used to take the download link of a large or binary file (pcap, zip). If the file does not exist, it gives a File not found: <file-name> error.

OrderFieldStatusValue
1The file nameRequiredThe name of the file in the area; it is written directly, without writing a field name
TR7 WEB-CLI · file show
admin@TR7LBWAF01> sys-cmd file show vip-443.pcap
admin@TR7LBWAF01>  

sys-cmd file content ​

It writes the content of a file directly to the screen. It is used to read text files (the outputs taken with to-file, such as dig, curl and ss) without downloading them.

OrderFieldStatusValue
1The file nameRequiredThe name of the file in the area; it is written directly, without writing a field name
SituationResult
The file is larger than 1 MBIt gives a File too large (…). Maximum: 1MB error; the file is downloaded from the link taken with file show
The file does not existFile not found: <file-name>
A binary file (pcap, zip)The content is printed as unreadable characters; these files are downloaded
TR7 WEB-CLI · file content
admin@TR7LBWAF01> sys-cmd dig app.example.com A +short | to-file dig-app.txt
admin@TR7LBWAF01> sys-cmd file content dig-app.txt
admin@TR7LBWAF01>  

sys-cmd file delete ​

It deletes one or more files. When it succeeds, it writes nothing to the screen.

OrderFieldStatusValue
1…The file nameRequiredOne or more file names, separated by spaces; a field name is not written

It does not ask for confirmation, it cannot be undone

The files are deleted in the order in which they are written. If a file in the list is not found, it stops with a File not found: <file-name> error; the files written before it have been deleted and the ones after it have not.

TR7 WEB-CLI · file delete
admin@TR7LBWAF01> sys-cmd file delete vip-443.pcap
admin@TR7LBWAF01> sys-cmd file delete dig-app.txt wrk-vip.txt vip-tls.txt
admin@TR7LBWAF01>  

sys-cmd file clean ​

It deletes the temporary file area together with all its files and recreates it empty at the configured size; when the work finishes, it writes Disk cleaned. This message is written even if the recreation step fails; that the area is ready for use is verified with file disk show. It is also used when the area is corrupted or when file disk show shows that the area is not mounted.

It does not ask for confirmation, it cannot be undone

Everything is deleted, including the captures and support bundles that have not been downloaded. First it is verified with file list that the necessary files have been downloaded.

TR7 WEB-CLI · file clean
admin@TR7LBWAF01> sys-cmd file clean
Disk cleaned
admin@TR7LBWAF01>  

sys-cmd file disk show ​

It summarizes the disk of the temporary file area in four lines.

LineContent
image:The disk file of the area and the size it occupies; if the file does not exist, missing
mounted:If the area is in use, the total, used and free space (total= · used= · free=); if not, NO
configured size:The size set with change-size; if it has never been set, not set (default 2G)
files written in the last 10 min:The number of files that have changed in the last 10 minutes; it shows whether there is a capture or a bundle production in progress
TR7 WEB-CLI · file disk show
admin@TR7LBWAF01> sys-cmd file disk show
image: … (…)
mounted: … total=… used=… free=…
configured size: not set (default 2G)
files written in the last 10 min: 1
admin@TR7LBWAF01>  

The values vary by device.

sys-cmd file disk change-size ​

It changes the size of the temporary file area. First the checks are made, and then the confirmation screen opens; when evet is written in the Turkish interface and yes in the English interface, the operation is applied. The new size is stored; after file clean the area is created at this size as well.

OrderFieldStatusValue
1The sizeRequiredAn integer between 2G and 64G; the unit is G and it is accepted as gigabytes even if it is not written (8 = 8G). The Tab suggestions: 4G · 8G · 16G · 32G · 64G
GrowingShrinking
InterruptionNone; the existing files and the running captures are not affectedThe area goes out of use for a few seconds; the files are kept
PreconditionAfter the growth, at least 10% of the total or 5 GB (whichever is greater) must remain free on the data diskThe used space must fit into the target size together with a headroom of 10% of the target or 128 MB (whichever is greater); there must be no capture or bundle production using the area at that moment
Confirmation titleYou are about to grow the temporary disk from <old> to <new>GYou are about to shrink the temporary disk from <old> to <new>G
ResultTemporary disk grown to <new>G (free: …).Temporary disk shrunk to <new>G (free: …).
TR7 WEB-CLI · file disk change-size
admin@TR7LBWAF01> sys-cmd file disk change-size 8G
⚠  You are about to grow the temporary disk from … to 8G
    Growth is performed live; existing files and running captures are not affected. Space is really allocated from the /rawdata disk.
 
Type "yes" to confirm: yes
Temporary disk grown to 8G (free: …).
admin@TR7LBWAF01>  

The Error Messages ​

MessageMeaning and solution
Invalid size: '…'. Example: 8G (range 2G-64G, unit is G)The size format is wrong; units such as M and T and decimal values are not accepted
Size must be within 2G-64G (requested: …G).The size is outside the range
Disk is already …G.The requested size is the same as the current size
Not enough space on /rawdata: …There is not enough free space on the data disk for the growth; a smaller size is chosen or the data disk is extended
Target is too small for the data on disk: …The shrink target is not enough for the used space; space is freed first with file delete or file clean
The disk is in use right now (pid: …). …A capture or a bundle production that uses the area is in progress; it is waited for to finish
The temporary disk does not appear to be mounted. Try "file clean" first. · Disk image not found: …The area is not in use or the disk file does not exist; it is recreated with file clean

Things to Know ​

  • When the area is full, to-file cannot write and a support bundle cannot be produced. How full it is is followed with file disk show; space is freed with file delete or the area is grown with file disk change-size.
  • If the data disk itself is to be extended, extend-data-disk is used.
  • For the rules of writing the output to a file, the Pipe Commands page is consulted.