Your directions a not entirely clear, but I believe the following performs the actions you requested and verifies that each action was performed successfully.
Although this script uses ksh, it should also work with at least sh and bash.
Last edited by Don Cragun; 08-29-2012 at 02:14 AM..
This User Gave Thanks to Don Cragun For This Post:
I Need help for one requirement,
I want to move the latest/Older file in the folder to another file. File have the datetimestamp in postfix.
Example:
Source Directory : \a
destination Directory : \a\b
File1 : xy_MMDDYYYYHHMM.txt (xy_032120101456.txt)
File2: xy_MMDDYYYYHHMM.txt... (1 Reply)
Hi,
I have the following subfolder with files:
/data/a/1/xxx.txt
/data/b/2/yyy.txt
/data/c/3/zzz.txt
And i have a set of new folders which have exactly the same structure as above but different disk without the files:
/data_02/a/1/
/data_02/b/2/
/data_02/c/3/
Now i would like to... (6 Replies)
suppose if i am checking folder g as shown below path
a/b/c/d/e/f/g ,and some directory c,d,e,f,g not present then is there anyway to create directory in one command
or i need to use mkdir for everyfolder (3 Replies)
Hi,
I have a filelist named filestomove.txt.
It can contain any number of files that need to be moved to a subdirectory.
All the files from filelist are in the same directory as the filelist, let say it's called Folder1.
All the files need to be moved to subfolder Folder1/Subfolder1.
... (1 Reply)
Hi Folks,
As part of my application I need to find out what the latest directory based
on the name of that directory (not it's file system timestamp).
Example: I have a directory which contains below directories (each of while contains files etc)
20120000/
20120000/
latest (symbolic link to... (5 Replies)
Hi,
Anybody help me to write a Shell Script
Get the latest file from the file list based on created and then move to the target directory.
Tried with the following script: got error.
A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head... (2 Replies)
Hi folks,
In my application there is a job running which create a .dat file along with it zip file also at unix box location /opt/app/cvf/temp1
so in temp1 directory I have one .dat file and its zip file also.
Now since this job runs every day so if a job runs today there will be two files... (5 Replies)
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Hello,
On Solaris 10, here are entries for logs in httpd.conf
ErrorLog "|/export/apache/apache-2.2.17/bin/rotatelogs -l -f /var/log/apache/error_log.%Y%m%d 86400"
It keeps creating daily logs with below names -
-rw-r--r-- 1 root root 1016747232 Apr 5 23:59... (16 Replies)
Discussion started by: solaris_1977
16 Replies
LEARN ABOUT OSX
simple
Simple action in tc(8) Linux Simple action in tc(8)NAME
simple - basic example action
SYNOPSIS
tc ... action simple [ sdata STRING ] [ index INDEX ] [ CONTROL ]
CONTROL := { reclassify | pipe | drop | continue | ok }
DESCRIPTION
This is a pedagogical example rather than an actually useful action. Upon every access, it prints the given STRING which may be of arbi-
trary length.
OPTIONS
sdata STRING
The actual string to print.
index INDEX
Optional action index value.
CONTROL
Indicate how tc should proceed after executing the action. For a description of the possible CONTROL values, see tc-actions(8).
EXAMPLES
The following example makes the kernel yell "Incoming ICMP!" every time it sees an incoming ICMP on eth0. Steps are:
1) Add an ingress qdisc point to eth0
2) Start a chain on ingress of eth0 that first matches ICMP then invokes the simple action to shout.
3) display stats and show that no packet has been seen by the action
4) Send one ping packet to google (expect to receive a response back)
5) grep the logs to see the logged message
6) display stats again and observe increment by 1
hadi@noma1:$ tc qdisc add dev eth0 ingress
hadi@noma1:$tc filter add dev eth0 parent ffff: protocol ip prio 5
u32 match ip protocol 1 0xff flowid 1:1 action simple sdata "Incoming ICMP"
hadi@noma1:$ sudo tc -s filter ls dev eth0 parent ffff:
filter protocol ip pref 5 u32
filter protocol ip pref 5 u32 fh 800: ht divisor 1
filter protocol ip pref 5 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1
match 00010000/00ff0000 at 8
action order 1: Simple <Incoming ICMP>
index 4 ref 1 bind 1 installed 29 sec used 29 sec
Action statistics:
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
hadi@noma1$ ping -c 1 www.google.ca
PING www.google.ca (74.125.225.120) 56(84) bytes of data.
64 bytes from ord08s08-in-f24.1e100.net (74.125.225.120): icmp_req=1 ttl=53 time=31.3 ms
--- www.google.ca ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 31.316/31.316/31.316/0.000 ms
hadi@noma1$ dmesg | grep simple
[135354.473951] simple: Incoming ICMP_1
hadi@noma1$ sudo tc/tc -s filter ls dev eth0 parent ffff:
filter protocol ip pref 5 u32
filter protocol ip pref 5 u32 fh 800: ht divisor 1
filter protocol ip pref 5 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1
match 00010000/00ff0000 at 8
action order 1: Simple <Incoming ICMP>
index 4 ref 1 bind 1 installed 206 sec used 67 sec
Action statistics:
Sent 84 bytes 1 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
SEE ALSO tc(8)tc-actions(8)iproute2 12 Jan 2015 Simple action in tc(8)