LinuxCommandLibrary

logsave

executes a command and saves both stdout and stderr to a log file

TLDR

Save command output to log

$ logsave [path/to/logfile] [command]
copy
Save stdin to log
$ logsave [logfile] -
copy
Append to log file
$ logsave -a [logfile] [command]
copy
Run with verbose output
$ logsave -v [logfile] [command]
copy

SYNOPSIS

logsave [options] logfile command [arguments]

DESCRIPTION

logsave executes a command and saves both stdout and stderr to a log file. It includes timestamps and exit status, making it useful for recording the output of scheduled tasks or system scripts.

PARAMETERS

-a

Append to log file instead of replacing
-v
Verbose mode
-
Read from stdin instead of running command

CAVEATS

Part of e2fsprogs package. The log file is created with timestamps for start, end, and command exit status.

SEE ALSO

script(1), tee(1), logger(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community