Sponsored Content
Top Forums Shell Programming and Scripting Help - To copy and compress files one day ago Post 302965877 by JackyJohn on Thursday 4th of February 2016 02:41:47 AM
Old 02-04-2016
Help - To copy and compress files one day ago

Hi dears,

Hi All,
I'm a new member of this Forum. I have need your help to handle this request.

"I want to copy and Compress files not of today but of yesterday only using some script".

For example

I have the following files under a particular directory in a Solaris machine.

Code:
-rw-r--r--   1 rtp99    dba          16M Feb  3 17:29 RtpTrcError.0034
-rw-r--r--   1 rtp99    dba          16M Feb  3 18:09 RtpTrcError.0035
-rw-r--r--   1 rtp99    dba          16M Feb  3 18:56 RtpTrcError.0036
-rw-r--r--   1 rtp99    dba          16M Feb  3 19:42 RtpTrcError.0037
-rw-r--r--   1 rtp99    dba          16M Feb  3 20:35 RtpTrcError.0038
-rw-r--r--   1 rtp99    dba          16M Feb  3 21:15 RtpTrcError.0039
-rw-r--r--   1 rtp99    dba          13M Feb  3 22:15 RtpTrcError.0040
-rw-r--r--   1 rtp99    dba          10M Feb  3 23:15 RtpTrcError.0041
-rw-r--r--   1 rtp99    dba         9.2M Feb  4 00:15 RtpTrcError.0042
-rw-r--r--   1 rtp99    dba         7.0M Feb  4 01:15 RtpTrcError.0043
-rw-r--r--   1 rtp99    dba         6.9M Feb  4 02:15 RtpTrcError.0044
-rw-r--r--   1 rtp99    dba         6.6M Feb  4 03:15 RtpTrcError.0045
-rw-r--r--   1 rtp99    dba         6.0M Feb  4 04:15 RtpTrcError.0046
-rw-r--r--   1 rtp99    dba         5.1M Feb  4 05:15 RtpTrcError.0047
-rw-r--r--   1 rtp99    dba         7.8M Feb  4 06:15 RtpTrcError.0048
-rw-r--r--   1 rtp99    dba          13M Feb  4 07:15 RtpTrcError.0049
-rw-r--r--   1 rtp99    dba          15M Feb  4 08:15 RtpTrcError.0050
-rw-r--r--   1 rtp99    dba          15M Feb  4 09:15 RtpTrcError.0051
-rw-r--r--   1 rtp99    dba          16M Feb  4 09:56 RtpTrcError.0052
-rw-r--r--   1 rtp99    dba          16M Feb  4 10:26 RtpTrcError.0053
-rw-r--r--   1 rtp99    dba         6.7M Feb  4 10:40 RtpTrcError.0054

I need to copy and compress ONLY the files of yesterday (Here 3 Feb).

Any suggestion will be well appreciated.

Thanks in advance for your kind support.

Regards,

Jacky.

Last edited by Don Cragun; 02-04-2016 at 03:54 AM.. Reason: Add CODE tags.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Compress and copy a Folder

hi Buddies , How can i Compress and move a folder through UNIX completely to windows 2000 through FTP. (1 Reply)
Discussion started by: scorpiyanz
1 Replies

2. Shell Programming and Scripting

Cron to run first day of month to calculate date 3 months ago

Hi, I would like to find out how can i calculate a date which is 3 months ago. I intend to run a cron job on the 1st of every month, and calculate the month 4 months earlier from the date. For example, if today's date is 1st May 2007, i would like to return 012007( January 2007). i can get... (1 Reply)
Discussion started by: new2ss
1 Replies

3. UNIX for Dummies Questions & Answers

Copy and compress

Is there a way to copy a file and compress it at the same time? I realize the file can be copied and then compressed, but I was wondering if it's possible to do it in a one-line command and for that matter, if it would be more efficient to perform the operation with a one-line command? Thanks. (5 Replies)
Discussion started by: here2learn
5 Replies

4. UNIX for Dummies Questions & Answers

Copy Compress as one command

Hi, I need to copy and compress files in a directory in single line of command. I am able to copy and gzip files in one command but not directory. Command that I am using for copying directory is below : cp -rp /u01/app/<directory> /u01/app/backup |gzip -r /u01/app/backup/<directory> ... (10 Replies)
Discussion started by: findprakash
10 Replies

5. Shell Programming and Scripting

How to extract the day of the year and use that info to copy a file remotely

Hello, Thank you in advance for helping a newbie who is having great trouble with this simple task. I'm allowed to copy one file remotely each night due to bandwidth restrictions. A new file gets generated once a day, and I need to copy the previous day's file. Here is what I'd like to do:... (1 Reply)
Discussion started by: tmozdzen
1 Replies

6. Shell Programming and Scripting

Help - compress file one day ago

Hi All, I'm a new member of this Forum. I have need your help to handle this request. "Compress a file name not of today but of yesterday only". For example 0 mar 08:00 TEST_RPT_STATUS_M1I_CMI20120320.xls 20 mar 08:00 TEST_RPT_STATUS_M1I_CMI20120320.rep 21 mar 08:00... (6 Replies)
Discussion started by: gio123bgg
6 Replies

7. Shell Programming and Scripting

script to compress files in directory that changes its name every day

Hi all I have the following script that should compress a file in a directory: # compress log files older than 2 days find /u01/easydone/DBDUMPS/*.dmp -mtime +2 -exec gzip {} \; BUT the problem is that these files that I want to compress are inside a directory with following format: ... (5 Replies)
Discussion started by: fretagi
5 Replies

8. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

9. Shell Programming and Scripting

How to copy all structure folder create last day?

HI All, please help , i got same case . i want copy folder and directory create yesterday. for sample below : drwxr-xr-x 4 apps apps 33 Nov 23 04:00 xxxxxx@gmai.com drwxr-xr-x 4 apps apps 33 Nov 23 04:00 yyyyyyy@gmail.com drwxr-xr-x 4 apps apps 33 Nov 24 04:00... (2 Replies)
Discussion started by: fajar_3t3
2 Replies
rt-setup-database(8)					     Request Tracker Reference					      rt-setup-database(8)

NAME
rt-setup-database - Set-up the database for Request Tracker SYNOPSIS
rt-setup-database --action ... OPTIONS
action Several actions can be combined using comma separated list. init Initialize the database. This is combination of multiple actions listed below. Create DB, schema, setup acl, insert core data and initial data. upgrade Apply all needed schema/acl/content updates (will ask for version to upgrade from) create Create the database. drop Drop the database. This will ERASE ALL YOUR DATA. schema Initialize only the database schema To use a local or supplementary datafile, specify it using the '--datadir' option below. acl Initialize only the database ACLs To use a local or supplementary datafile, specify it using the '--datadir' option below. coredata Insert data into RT's database. This data is required for normal functioning of any RT instance. insert Insert data into RT's database. By default, will use RT's installation data. To use a local or supplementary datafile, specify it using the '--datafile' option below. datafile file path of the data you want to action on e.g. "--datafile /path/to/datafile" datadir Used to specify a path to find the local database schema and acls to be installed. e.g. "--datadir /path/to/" dba dba's username dba-password dba's password prompt-for-dba-password Ask for the database administrator's password interactively skip-create for 'init': skip creating the database and the user account, so we don't need administrator privileges root-password-file for 'init' and 'insert': rather than using the default administrative password for RT's "root" user, use the password in this file. perl v5.14.2 2013-05-22 rt-setup-database(8)
All times are GMT -4. The time now is 06:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy