skulker [-irw] [-l logfile] directory days_old
Removes files in directory older than specified number of days
shell script in /samples
- copy to /bin/skulker or /usr/sbin/skulker
- can be modified by installation
- Protect it from hackers! (make it non-writable)
e.g. skulker /tmp/ 100
deletes files in /tmp older than 100 days
trailing slash follows a /tmp symlink to another directory
- use cron to schedule it to run regularly
fuser [-cfku] file ...
- List process IDs of processes with open files - Useful for finding the current users of a file, or a filesystem (e.g. before unmount)
- e.g. fuser -cu /usr/lpp/dfs shows who is using the containing filesystem
uptime
- Display how long the system has been IPLed - e.g. uptime 01:02PM up 14 day(s), 01:15, 58 users, load average: 0.00, 0.00, 0.00
Finding file opens in Unix
rbd2/u/drbd:>fuser
-u $LOGS/evtlog.2016-04-12
/plex/var/trb/rbd2/dps1/logs/evtlog.2016-04-12:
33620442(DRBD)
rbd2/u/drbd:>ps
-p 33620442
PID TTY TIME CMD
33620442 ? 1:09
/plex/var/trb/rbd2/dps1/lib/sislib/sievtq.exe
No comments:
Post a Comment