Can you please replace this line : -o -name '*(MON)*' with below code
-o -name '*(MON|TUE|WED|THU|FRI|SAT|SUN)*'
Hope this works 4 u
---------- Post updated at 05:29 AM ---------- Previous update was at 05:25 AM ----------
Quote:
Originally Posted by mirni
That looks good. No need for the -print switch, but it shouldn't influence performance.
You misunderstood. If the directory tree is on machine A's hard drive, and it's mounted on machine B's /mnt, running
on machine B is much slower than running
directly on machine A (e.g. through ssh).
I think , by having xargs in command will add burden on tunning, since first it will add files in buffer then it will remove where as in direct command , it will keep removing once it finds the file/dir.
Hi Frineds,
I want to delete a set of files which are older than 7 days from teh current date.I am totally enw to shell scripting, can anyone help me with a sample code to list out the files which are older and then remove them from the directory.
Please help
THanks
Viswa (5 Replies)
find /filearchive/ -type f -mtime +7 -exec rm weblogs*.log {} \;
This worked only if this comand is executed int he unix comand prompt, but when i put this in the shell script it is not recognizing the file.It says weblogs: No such file or directory
Am i doing anything wrong here ? (4 Replies)
Hi
I have a job that will be running nightly incremental backsup of a large directory tree.
I did the initial backup, now I want to write a script to verify that all the files were transferred correctly. I did something like this which works in principle on small trees:
diff -r -q... (6 Replies)
Hi,
As a a security audit, how can I proceed further with Fine tuning and Hardening the linux kernel... I am not sure with the steps how to proceed further... If i do some thing wrong, then its comes with the Kernel panic error. So, I am afraid, how to do the tuning with the kernel.. (1 Reply)
Hi all,
I try to write shell script to the below requirement.
I have Hard coded the oratab location and take the list of databases from oratab and find out archive log locations for each database,
and list more than 3 days old files for each location and purge those.
... (2 Replies)
Hello All,
I want to delete the files based on the days. like, Files available under directory /abc want to delete if they are older than 15 days.
Files available under directory /pqr want to delete if they are 7 days old and some files under directory /xyz should get deleted if they are... (5 Replies)
i would like to know how can i fine tune the following query since the cost of the query is too high ..
insert into temp temp_1 select a,b,c,d from xxxx
.. database used is IDS.. (1 Reply)
Hi,
I have this routine that reads a microsoft dhcp.netsh dump. Where it finds optionvalue 3 STRING "0.0.0.0"
Replace it with the router IP based on the network
!/usr/bin/perl
while ( <> )
{
if ( /\# NET / ) { $net = $'; $net =~ s///g; }
else
{
s/set optionvalue 3... (1 Reply)
Hi All,
I am looking forward to create a unix shell script to purge the files.
The requirement is:
1) Do df -k and check the current space occupied for the /a1 folder.
2) If the space consumed is greater than 90 %, delete all the DEF* files from a subfolder /a1/archive.
Example:
df... (4 Replies)
hi,
We have a huge directory that ha 5.1 Million files in it. We are trying to get the file name and modified timestamp of the most recent 3 years from this huge directory for a migration project.
However, the ls command (background process) to list the file names and timestamp is running for... (2 Replies)
Discussion started by: subbu
2 Replies
LEARN ABOUT POSIX
systemd-machine-id-setup
SYSTEMD-MACHINE-ID-SETUP(1) systemd-machine-id-setup SYSTEMD-MACHINE-ID-SETUP(1)NAME
systemd-machine-id-setup - Initialize the machine ID in /etc/machine-id
SYNOPSIS
systemd-machine-id-setup
DESCRIPTION
systemd-machine-id-setup may be used by system installer tools to initialize the machine ID stored in /etc/machine-id at install time, with
a provisioned or randomly generated ID. See machine-id(5) for more information about this file.
If the tool is invoked without the --commit switch, /etc/machine-id is initialized with a valid, new machined ID if it is missing or empty.
The new machine ID will be acquired in the following fashion:
1. If a valid D-Bus machine ID is already configured for the system, the D-Bus machine ID is copied and used to initialize the machine ID
in /etc/machine-id.
2. If run inside a KVM virtual machine and a UUID is configured (via the -uuid option), this UUID is used to initialize the machine ID.
The caller must ensure that the UUID passed is sufficiently unique and is different for every booted instance of the VM.
3. Similarly, if run inside a Linux container environment and a UUID is configured for the container, this is used to initialize the
machine ID. For details, see the documentation of the Container Interface[1].
4. Otherwise, a new ID is randomly generated.
The --commit switch may be used to commit a transient machined ID to disk, making it persistent. For details, see below.
Use systemd-firstboot(1) to initialize the machine ID on mounted (but not booted) system images.
OPTIONS
The following options are understood:
--root=root
Takes a directory path as argument. All paths operated will be prefixed with the given alternate root path, including the path for
/etc/machine-id itself.
--commit
Commit a transient machine ID to disk. This command may be used to convert a transient machine ID into a persistent one. A transient
machine ID file is one that was bind mounted from a memory file system (usually "tmpfs") to /etc/machine-id during the early phase of
the boot process. This may happen because /etc is initially read-only and was missing a valid machine ID file at that point.
This command will execute no operation if /etc/machine-id is not mounted from a memory file system, or if /etc is read-only. The
command will write the current transient machine ID to disk and unmount the /etc/machine-id mount point in a race-free manner to ensure
that this file is always valid and accessible for other processes.
This command is primarily used by the systemd-machine-id-commit.service(8) early boot service.
--print
Print the machine ID generated or committed after the operation is complete.
-h, --help
Print a short help text and exit.
--version
Print a short version string and exit.
EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise.
SEE ALSO systemd(1), machine-id(5), systemd-machine-id-commit.service(8), dbus-uuidgen(1), systemd-firstboot(1)NOTES
1. Container Interface
https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface
systemd 237SYSTEMD-MACHINE-ID-SETUP(1)