Get the App
SLTechnology News&Howtos  ›  Servers  › 

The ineffective troubleshooting of timing operation in Ubuntu system

Shulou Source: shulou.com Published: 2022-06-02 05:21:26 10月02日 Update

Because a database log file expands indefinitely and finally fills up the disk space, the database Hang resides. To monitor the log file growth, create a scheduled job to execute the following SQL command to query the data file size:

Select f.name, file_id fileid, physical_name filename, g.name filegroup

, iif (size

< 128, cast(size * 8 as varchar) + ' KB' , iif(size / 128 < 1024, cast(size / 128 as varchar) + ' MB' , cast(size / 128 / 1024 as varchar) + ' GB')) size , iif(max_size=-1, 'Unlimited' , iif(max_size/dev/null 2>

& 1

4. Take the command in CRON as a shell command, execute the shell command in CRON, and add "> / dev/null 2 > & 1" at the end, the scheduled task finally has a result.

Csyy@server02:~$ crontab-l

25 * ShellCmd.sh > / dev/null 2 > & 1

Csyy@server02:~$ cat ShellCmd.sh

Sqlcmd-S. -U sa-P 'Password'-I MonitEmrFileSize.sql-o checkfilesize/ `date +% Y% m% d.H% M.txt`

Explanation: step 3, although from the Shell command point of view, standard output and standard error output have all been redirected, the command has no output, but also nested in the command a Shell command date, standard output and standard error output are not redirected, resulting in triggering "not installed MTA" error.

Tags: Command output job standard error file task data result database log user or effect system normal cause size situation time Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info Shulou Technology Shulou Information MySQL