09-11-2009
Every day when the job wil run and pick up the file from products directory, you can create a new directory using mkdir (as shown in above post), and then put the file there. Use -p option to create the parent(s) direcotires as well i.e. for the new year/month.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i want to delete files that are one day old
condition is files should be of current month only ie if iam running script on 1 march it should not delete files of 28 feb(29 if leap year :-)}
any modifications to
find $DIR -type f -atime +1 -exec rm -f{}\; (4 Replies)
Discussion started by: maverick
4 Replies
2. Shell Programming and Scripting
I have a date that looks like this:
2008/100:18:40:47.040
I need it to look like this:
2008 04 09 18 40 47 040
I have looked at datecalc and it doesn't seem like it takes the day of year for this year (or whatever year is input) and converts it into month and day. It also has to account... (2 Replies)
Discussion started by: ajgwin
2 Replies
3. Shell Programming and Scripting
Dear All,
Actually, i'm doing some reporting job and i need to pass yesterday's date in Year-Month-Day format(e.g. 2009-06-10) to another program for generating 2009-06-10 report.
to get today's date, it's easy to just date '+%Y%m%d' , but no idea how can i get this kind of format for... (2 Replies)
Discussion started by: tiger2000
2 Replies
4. AIX
Hello,
How do I convert unix timestamp value to 'normal' date format - to get year month and day values ?
Looks like it's easy to do using GNU date (linux systems). But how do I do tthis on AIX ?
I don't want to write C program, any ways to do that using unix shells ?
thanks (1 Reply)
Discussion started by: vilius
1 Replies
5. Shell Programming and Scripting
Hi
I have files like
abc_cd_20110302_123423
abc_cd_ef_20110301_123423
abc_cd_ef_20110403_123423
abc_ef_20110401_123423
I want to extract the
the year and month associated with each file.
I tried
logfileyearmonth=`echo $logfile | awk -F_'{print $NF}'`
Any other way can I... (6 Replies)
Discussion started by: dgmm
6 Replies
6. Shell Programming and Scripting
hello,
I have many files called day001, day002, day003 and I want to rename them by day20070101, day20070102, etc.
I need to do it for several years and leap years as well.
What is the best way to do it ?
Thank you. (1 Reply)
Discussion started by: Ggg
1 Replies
7. Shell Programming and Scripting
Hi All,
I need to find all files other than first two files dates & last file date for month and month/year wise list.
lets say there are following files in directory
Mar 19 2012 c.txt
Mar 19 2012 cc.txt
Mar 21 2012 d.txt
Mar 22 2012 f.txt
Mar 24 2012 h.txt
Mar 25 2012 w.txt
Feb 12... (2 Replies)
Discussion started by: Makarand Dodmis
2 Replies
8. Shell Programming and Scripting
Hi All,
I find all files for same month and year
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 c.txt
-rwxr-xr-x 1 user userg 1596 Mar 21 2012 d.txt
-rwxr-xr-x 1 user userg 1596 Mar 22 2012 f.txt
-rwxr-xr-x 1... (8 Replies)
Discussion started by: Makarand Dodmis
8 Replies
9. Shell Programming and Scripting
how to find all files other than first two dates & last date per month and year
Hi All,
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt
-rwxr-xr-x 1 user userg ... (6 Replies)
Discussion started by: Makarand Dodmis
6 Replies
10. Shell Programming and Scripting
Hi All,
lets say there are following files in directory
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 a.txt
-rwxr-xr-x 1 user userg 1596 Mar 19 2012 b.txt
-rwxr-xr-x 1 user userg 1596 Mar 22 2012 c.txt
-rwxr-xr-x 1 user userg 1596 Mar 24 2012 d.txt... (16 Replies)
Discussion started by: Makarand Dodmis
16 Replies
LEARN ABOUT LINUX
shtool-mkdir
SHTOOL-MKDIR.TMP(1) GNU Portable Shell Tool SHTOOL-MKDIR.TMP(1)
NAME
shtool-mkdir - GNU shtool mkdir(1) style command
SYNOPSIS
shtool mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode mode] [-o|--owner owner] [-g|--group group] dir [dir ...]
DESCRIPTION
This is a mkdir(1) style command with additional options and the ability to be smart if the directory already exists which is important for
installation procedures.
OPTIONS
The following command line options are available.
-t, --trace
Shows the actually involved shell commands.
-f, --force
Forced continuation and no complaints if directory already exists. Default is to terminate with error.
-p, --parents
Automatic parent directory creation. Default is to only create the last directory in the path and fail if parents are missing.
-m, --mode mode
The directory mode applied to the directory, see chmod(1). Omitting mode skips this step and leaves the operating system default which
is usually based on umask(1). Some directory modes require superuser privileges to be set. Default is to stick with operating system
defaults.
-o, --owner owner
The directory owner name or id applied to the directory, see chown(1). This option requires superuser privileges to execute. Default
is to skip this step and leave the operating system default which is usually based on the executing uid or the parent setuid directory.
-g, --group group
The directory group name or id applied to the directory, see chgrp(1). This option requires superuser privileges to execute to the
fullest extend, otherwise the choice of group is limited on most operating systems. Default is to skip this step and leave the
operating system default which is usually based on the executing gid or the parent setgid directory.
EXAMPLE
# Makefile
install:
shtool mkdir -f -p -m 755 $(bindir)
shtool mkdir -f -p -m 755 $(mandir)/man1
:
HISTORY
The GNU shtool mkdir command was originally written for Public Domain by Noah Friedman and later revised by Ralf S. Engelschall
<rse@engelschall.com> in 1999 for inclusion into GNU shtool.
SEE ALSO
shtool(1), mkdir(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-MKDIR.TMP(1)