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
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
| Subject | Behavior |
|---|---|
| Context | It is not affected by the selected v-device and route table; it always runs in the temporary file area of the device. |
| File names | The 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. |
| Downloading | The address in the Link column downloads the file; every download is written to the user logs as "<file>" name CLI file downloaded. |
| Persistence | The 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. |
| Recording | Every 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.
| Column | Content |
|---|---|
| Filename | The name of the file |
| File size | The size with a readable unit |
| Last modified | In the YYYY-MM-DD HH:MM:ss format |
| Link | The address that downloads the file |
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.
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | The file name | Required | The name of the file in the area; it is written directly, without writing a field name |
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.
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | The file name | Required | The name of the file in the area; it is written directly, without writing a field name |
| Situation | Result |
|---|---|
| The file is larger than 1 MB | It gives a File too large (…). Maximum: 1MB error; the file is downloaded from the link taken with file show |
| The file does not exist | File not found: <file-name> |
| A binary file (pcap, zip) | The content is printed as unreadable characters; these files are downloaded |
sys-cmd file delete
It deletes one or more files. When it succeeds, it writes nothing to the screen.
| Order | Field | Status | Value |
|---|---|---|---|
| 1… | The file name | Required | One 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.
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.
sys-cmd file disk show
It summarizes the disk of the temporary file area in four lines.
| Line | Content |
|---|---|
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 |
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.
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | The size | Required | An 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 |
| Growing | Shrinking | |
|---|---|---|
| Interruption | None; the existing files and the running captures are not affected | The area goes out of use for a few seconds; the files are kept |
| Precondition | After the growth, at least 10% of the total or 5 GB (whichever is greater) must remain free on the data disk | The 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 title | You are about to grow the temporary disk from <old> to <new>G | You are about to shrink the temporary disk from <old> to <new>G |
| Result | Temporary disk grown to <new>G (free: …). | Temporary disk shrunk to <new>G (free: …). |
The Error Messages
| Message | Meaning 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-filecannot write and a support bundle cannot be produced. How full it is is followed withfile disk show; space is freed withfile deleteor the area is grown withfile disk change-size. - If the data disk itself is to be extended,
extend-data-diskis used. - For the rules of writing the output to a file, the Pipe Commands page is consulted.
