⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spacegripe

📁 A* sudo sudo/* B* adduser script adduser C* rmuser script rmuser E* tout tout/*
💻
字号:
#!/bin/csh -f## spacegripe - identify and send mail to disk hogs## usage: spacegripe partition-name# partition-name should be a path name (/users, etc.), not a device name#set partition = `echo $argv[1] | sed 's/\///g'`## Extract users from passwd file.#cat /etc/passwd | \awk -F: '{ print $6 }'  |\grep ${argv[1]}/ > /tmp/$partition.homedirs## Determine who the hogs are - people with 750 or more disk blocks#du -s `cat /tmp/$partition.homedirs` | sort -nr |\awk '{if ($1 > 749) print $0}' > /tmp/$partition.du.users## Extract usernames.#sed 's/^.*.\///' < /tmp/$partition.du.users > /tmp/$partition.users## compose a letter...#cat << MUCK > /tmp/$partition.messageThe Disk partition on which your home directory resides is almost full.The following is a list of home directories and their sizes measured in Kilobytes:MUCKcat /tmp/$partition.du.users >> /tmp/$partition.messagecat << MUCK >> /tmp/$partition.messageAs a large consumer of space on this partition, you should considerdeleting unwanted files.  This disk partition is backed up at regularintervals. Anything that you delete may be retrieved from thesebackup tapes in an emergency. For large files that you need regularly, you might consider the 'compress'program. Do a 'man compress' for more info.This situation is critical. It requires immediate action on your part.If you have any technical problems, please send mail to the systemadministrator. Sincerely,spacegripe@`hostname`.MUCK#/usr/ucb/mail -s "`hostname`:/$partition is very full" \    `cat /tmp/$partition.users` systems < /tmp/$partition.message#cd /tmprm $partition.*

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -