Your script does not work for several reasons.
The du -x ... is run in the current directory.
root's home directory is / so it takes very long to traverse all the files. Then, the du output consists of numbers and directories. The for loop cycles through all of them. The code in the loop is run over and over again.
Now you know why it takes so long.
--
Once upon a time I created a script that rotates HP-UX system log files.
Useful on systems that are not regularly rebooted.
It is run by the crontab entry:
And the executable /usr/lib/newsyslog looks like this
If you have understood it, you can add more things to the LOGS= strings.
Last edited by MadeInGermany; 05-10-2017 at 04:57 PM..
Hello. I should have asked this awhile ago but here is my situation. My task is to generate LOC for different directories. I have a text file that has dates in this format (01-Aug-2006). My task is to read each line and compare it to a branch date. Depending on the date, it should generate a... (0 Replies)
I have a log file on our system which fills up with lines that have been timestamped, as follows....
03/03/2008 10:56:06:815] (ERROR) balance: continuing session to genapp02 : 18500
03/03/2008 10:56:06:820] (ERROR) balance: continuing session to genapp02 : 18500
03/03/2008 10:56:07:003]... (2 Replies)
Here's my problem: the $1 parameter is getting permanently set when you dot-run a script - and I cannot unset it.
Here's how to duplicate the problem:
1) Create a script called testme and put this simple command in the script:
echo 1=$1
Save the script
2) Make the testme script... (12 Replies)
I'd like to create a cron script that checks filesystems. For example if it reaches 95% USED, I'd like it to send me an email. Can this be possible for up to say 4 filesystems using the df -k command? Any samples to get me started would be much appreciated. (7 Replies)
Hi all,
I got an error when running this script (from BigAdmin community)
the error is
test: argument expected
my server version is
SunOS XXX 5.8 Generic_117350-46 sun4u sparc SUNW,Sun-Fire-V890
any idea on it?
#! /usr/bin/ksh
###
### This script can be run from cron to... (9 Replies)
Hey guys I am learning Linux and I am working on script for a college class project to check usage of file system. I pulled this from a different site but have to tweak it a little to work but I still get errors. Here is what I got so far.
ALERT=5
function main_prog() {
while read output;... (1 Reply)
Hi,
I wanted to find out that in my database server which filesystems are shared storage and which filesystems are local. Like when I use df -k, it shows "filesystem" and "mounted on" but I want to know which one is shared and which one is local.
Please tell me the commands which I can run... (2 Replies)
Dear all,
We are facing prolem when we are going to mount AIX filesystem, the system returned the following error
0506-307The AFopen call failed
: A file or directory in the path name does not exist.
But when we ls filesystems in the /etc/ directory it show
-rw-r--r-- 0 root ... (2 Replies)
Good day UNIX forum, could you help me with my clear printer queue script, i have problems with the consistency of this function, sometimes it works sometimes it doesn't. Thanks in advance
}
preRemovePrintQ(){
clear;
echo;
echo... (1 Reply)
I am new to Shell Scripting and need some help.
The following batch job has been failing for me due to the .nfsxxx files in use. I need to know how to modify the following script to exclude the .nfsxxx files so this batch job will not fail on me. I have done lots of googling and keep coming back... (2 Replies)
Discussion started by: kimberlyg2007
2 Replies
LEARN ABOUT CENTOS
systemd-journald.service
SYSTEMD-JOURNALD.SERVICE(8) systemd-journald.service SYSTEMD-JOURNALD.SERVICE(8)NAME
systemd-journald.service, systemd-journald.socket, systemd-journald - Journal service
SYNOPSIS
systemd-journald.service
systemd-journald.socket
/usr/lib/systemd/systemd-journald
DESCRIPTION
systemd-journald is a system service that collects and stores logging data. It creates and maintains structured, indexed journals based on
logging information that is received from the kernel, from user processes via the libc syslog(3) call, from STDOUT/STDERR of system
services or via its native API. It will implicitly collect numerous meta data fields for each log messages in a secure and unfakeable way.
See systemd.journal-fields(7) for more information about the collected meta data.
Log data collected by the journal is primarily text-based but can also include binary data where necessary. All objects stored in the
journal can be up to 2^64-1 bytes in size.
By default, the journal stores log data in /run/log/journal/. Since /run/ is volatile, log data is lost at reboot. To make the data
persistent, it is sufficient to create /var/log/journal/ where systemd-journald will then store the data.
systemd-journald will forward all received log messages to the AF_UNIXSOCK_DGRAM socket /run/systemd/journal/syslog, if it exists, which
may be used by Unix syslog daemons to process the data further.
See journald.conf(5) for information about the configuration of this service.
SIGNALS
SIGUSR1
Request that journal data from /run/ is flushed to /var/ in order to make it persistent (if this is enabled). This must be used after
/var/ is mounted, as otherwise log data from /run is never flushed to /var regardless of the configuration.
SIGUSR2
Request immediate rotation of the journal files.
KERNEL COMMAND LINE
A few configuration parameters from journald.conf may be overridden on the kernel command line:
systemd.journald.forward_to_syslog=, systemd.journald.forward_to_kmsg=, systemd.journald.forward_to_console=
Enables/disables forwarding of collected log messages to syslog, the kernel log buffer or the system console.
See journald.conf(5) for information about these settings.
ACCESS CONTROL
Journal files are, by default, owned and readable by the "systemd-journal" system group but are not writable. Adding a user to this group
thus enables her/him to read the journal files.
By default, each logged in user will get her/his own set of journal files in /var/log/journal/. These files will not be owned by the user,
however, in order to avoid that the user can write to them directly. Instead, file system ACLs are used to ensure the user gets read access
only.
Additional users and groups may be granted access to journal files via file system access control lists (ACL). Distributions and
administrators may choose to grant read access to all members of the "wheel" and "adm" system groups with a command such as the following:
# setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/
Note that this command will update the ACLs both for existing journal files and for future journal files created in the /var/log/journal/
directory.
FILES
/etc/systemd/journald.conf
Configure systemd-journald behaviour. See journald.conf(5).
/run/log/journal/machine-id/*.journal, /run/log/journal/machine-id/*.journal~, /var/log/journal/machine-id/*.journal,
/var/log/journal/machine-id/*.journal~
systemd-journald writes entries to files in /run/log/journal/machine-id/ or /var/log/journal/machine-id/ with the ".journal" suffix. If
the daemon is stopped uncleanly, or if the files are found to be corrupted, they are renamed using the ".journal~" suffix, and
systemd-journald starts writing to a new file. /run is used when /var/log/journal is not available, or when Storage=volatile is set in
the journald.conf(5) configuration file.
SEE ALSO systemd(1), journalctl(1), journald.conf(5), systemd.journal-fields(7), sd-journal(3), setfacl(1), pydoc systemd.journal.
systemd 208SYSTEMD-JOURNALD.SERVICE(8)