Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The ineffective troubleshooting of timing operation in Ubuntu system

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report