Sponsored Content
Full Discussion: handle file by month
Top Forums Shell Programming and Scripting handle file by month Post 302355762 by durden_tyler on Wednesday 23rd of September 2009 04:17:05 PM
Old 09-23-2009
Quote:
Originally Posted by leim
...
so that when it changes month,
...
What do you mean by "when it changes month" ?

Do you just want to create a new file, say, "alert_Mon.log" on the 1st of every month, where Mon is the 3-character month abbreviation ?

Code:
if [ "$(date +%d)" == "01" ] ; then  touch alert_$(date +%b).log; fi

tyler_durden
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

NFS file handle

How can I kill mount connection(NFS , made by automount) if remote filesystem is down? I tried: fuser -ku /auto /auto: umount /auto nfs umount: ERROR: /auto is busy If I try cd /auto - I get - /auto: Stale remote file handle. I know that reboot will help but I cannot reboot this... (2 Replies)
Discussion started by: kazimir
2 Replies

2. UNIX for Advanced & Expert Users

Stale NFS file handle

Hi, I get an error saying "Stale NFS file handle" how can I solve this? Is it possible to do this with a umount/ mount command? (5 Replies)
Discussion started by: rein
5 Replies

3. Programming

deleting a file name by its handle

All, I am having three function 1.open 2.process 3.close. Open will open a file and process will process a file and close will close the file .. I can able to close the file by its filehandler.Is there is anyway that i can get the file name by filehandle and remove it after... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

4. AIX

how to handle potential file contention

I need to change how a posting procedure currently works in order to improve load balancing but I am hitting a potential file contention problem that I was wondering if someone here could assist me with... In a directory called FilePool I would have a bunch of files that are constantly coming in... (3 Replies)
Discussion started by: philplasma
3 Replies

5. UNIX for Dummies Questions & Answers

print previous month (current month minus 1) with Solaris date and ksh

Hi folks month=`date +%m`gives current month Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies

6. Solaris

Before I delete any file in Unix, How can I check no open file handle is pointing to that file?

I know how to check if any file has a unix process using a file by looking at 'lsof <fullpath/filename>' command. I think using lsof is very expensive. Also to make it accurate we need to inlcude fullpath of the file. Is there another command that can tell if a file has a truely active... (12 Replies)
Discussion started by: kchinnam
12 Replies

7. UNIX for Advanced & Expert Users

How to decode nfs file handle in HP-UX?

Hi Experts, Any idea how to decode file handle in HP-UX? I am getting the following error continously in my HP-UX 11.31 box :mad: Apr 26 07:15:00 host62 su: + tty?? root-bb Apr 26 07:15:00 host62 su: + tty?? root-abcadm Apr 26 07:15:01 host62 vmunix: NFS write error on host peq9vs:... (1 Reply)
Discussion started by: vipinable
1 Replies

8. Shell Programming and Scripting

Script to counting a specific word in a logfile on each day of this month, last month etc

Hello All, I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer. Any ideas would be appreciated! (5 Replies)
Discussion started by: pnara2
5 Replies

9. UNIX for Dummies Questions & Answers

Difference between handle to the thread HANDLE and thread identifier pthread_t

This question might be silly but its confusing me a bit: What is the difference between handle to the thread HANDLE and thread identifier pthread_t? ---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ---------- Sorry I saw details and HANDLE is in windows and... (0 Replies)
Discussion started by: rupeshkp728
0 Replies

10. Shell Programming and Scripting

How to add decimal month to some month in sql, php, perl, bash, sh?

Hello, i`m looking for some way to add to some date an partial number of months, for example to 2015y 02m 27d + 2,54m i need to write this script in php or bash or sh or mysql or perl in normal time o unix time i`m asking or there are any simple way to add partial number of month to some... (14 Replies)
Discussion started by: bacarrdy
14 Replies
sa2(8)							    BSD System Manager's Manual 						    sa2(8)

NAME
sa2 -- Generate a system activity daily report file. SYNOPSIS
/usr/lib/sa/sa2 [-dgpu] [-n mode] [-e time] [-f filename] [-i seconds] [-s time] DESCRIPTION
The sa2 command is a shell script used to invoke the system activity reporter sar for purposes of generating the standard default daily report file. The report file generated is, /var/log/sa/sardd where the dd represents the current day of the month. The sa2 options are the same as those documented in sar(1). When sa2 runs, it will also remove data and report files, found in /var/log/sa, that are more than one week old. The sa2 command is intended to be started by cron. EXAMPLE CRON ENTRY
# Starting at 8am collect system activity records # every 20 minutes for 12 hours # 20 minutes = 1200 seconds # 12 hours with 3 samples each hour = 36 loops 0 8 * * 1-5 /usr/lib/sa/sa1 1200 36 # After the 12 hour period, # collect a system activity report 30 20 * * 1-5 /usr/lib/sa/sa2 -A FILES
/var/log/sa/sardd Default daily report file. /var/log/sa/sadd Default daily data file. dd are digits that represent the day of the month. SEE ALSO
crontab(1), fs_usage(1), netstat(1), sar(1), sc_usage(1), top(1), vm_stat(1), crontab(5), iostat(8), sa1(8), sadc(8) Mac OS X Jul 25 2003 Mac OS X
All times are GMT -4. The time now is 01:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy