Sponsored Content
Full Discussion: File Archive Script
Top Forums Shell Programming and Scripting File Archive Script Post 302107224 by KeesH on Thursday 15th of February 2007 09:17:57 AM
Old 02-15-2007
File Archive Script

Hi There,

I want to create a script that will archive files out of a log folder into seperate folders below it, but I need it to keep the previous 2 days worth of information. Now I know I can easily get a script to put the files in there but I don't know how to only get files older than 2 days, my problem is that the file name doesn't have a date in it so i'll need to use the following date to decide which ones to archive
-rw-r--r-- 1 ugpea eupuk 1824 15 Feb 14:14 submit_rep_15141419_4042930.log
-rw-rw-r-- 1 eupuk eupuk 400483 15 Feb 14:14 med_main.log
-rw-r--r-- 1 root system 4001576 15 Feb 14:15 jobwatch_eupuk.log
-rw-r--r-- 1 root system 50384302 15 Feb 14:15 socketserver_eupuk.log
-rw-rw-r-- 1 eupuk eupuk 374478 15 Feb 14:15 provision_script.log

I think I can use an awk command but have never used it before, does anyone know what command I should use?

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to archive file

Hi All, I am trying to archive a file. I have the script to archive a file which is given below: #! /usr/bin/sh INITFILE="US_Recon" INITDIR="/var/opt/l2/CSN1/ap21" TMPDIR="/var/opt/sap2bn/out/CSN1/ap21/tmp" ARCHDIR="/var/opt/l2/CSN1/ap21" FINALDIR="/var/opt/sap2bn/out/CSN1/ap21"... (0 Replies)
Discussion started by: indira
0 Replies

2. Shell Programming and Scripting

Generic Shell Script to Archive a file

Would appreciate if any one can paste a generic schell script to archive a file with date stamp by passing the file with fullpath as parameter For Eg. /apps/scripts/Archive_File.sh /data_home/project_home/file.txt this should place the file in the following directory ... (8 Replies)
Discussion started by: mak1600
8 Replies

3. Shell Programming and Scripting

Archive script

hi guru, can advise how to construct a housekeeping script using perl for the following ? find /var/tmp/logs -name "si*" -type f -exec gzip -f {} \; find /var/tmp/logs -name "*.gz" -type f -exec mv -f {} /var/tmp/log \; I found out those are not working in shell at when put them on... (1 Reply)
Discussion started by: rauphelhunter
1 Replies

4. Shell Programming and Scripting

script help .. archive

Hi All We have a landing directory where source system puts files.There are variable number of files and the file names are also varying.Each files successful transmission is identified by a .done file.If file name is xyz.dat then the confirmation file will be xyz.dat.done. I want to... (1 Reply)
Discussion started by: dr46014
1 Replies

5. Shell Programming and Scripting

need help archive script

Hi all, I am new to linux and scripting so please forgive me. I need to create a script that will archive files but the max size of the archive need to be 500mb or under. I know about the archiving with parts but i want all the archives as individual archives. Can anyone point me in the correct... (7 Replies)
Discussion started by: craig0
7 Replies

6. Shell Programming and Scripting

Shell Script for moving 3 days old file to Archive Folder

Hi Experts, I have a "Source" folder which may contain some files. I need a shell script which should move all files which are older than 3 days to "Archive" folder. Thanks in Advance... (4 Replies)
Discussion started by: phani333
4 Replies

7. Shell Programming and Scripting

Perl script to Archive the data file after the load

I have written a perl scripts which loads the data. Now i want to modify the script, to Archive the Input file after the successful load of data. Can anyone please share it and help me .... Thanks. (2 Replies)
Discussion started by: msrahman
2 Replies

8. Shell Programming and Scripting

Create archive and nil the content of log file using script

Plese help I need a urgent requirement. Ex: test.log requirement : using shell script I need to archive the log file and nil and the content of (test.log) file to 0 kb and then in the archive folder log files are name to test.tar test1.tar test2.tar EX: /home/abc/ test.log ... (1 Reply)
Discussion started by: johney1981
1 Replies

9. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

10. Shell Programming and Scripting

Script to archive logs and sftp to another archive server

Requirement: Under fuse application we have placeholders called containers; Every container has their logs under: <container1>/data/log/fuse.log <container1>/data/log/fuse.log.1 <container1>/data/log/fuse.log.XX <container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies
file-roller(1)							   User Commands						    file-roller(1)

NAME
file-roller - create, view, modify, or unpack an archive SYNOPSIS
file-roller [--add] [--add-to=archive] [--default-dir=folder] [--extract] [--extract-to=folder] [--force] [--help] [--usage] DESCRIPTION
The File Roller application enables you to create, view, modify, or unpack an archive. An archive is a file that acts as a container for other files. An archive can contain many files, folders, and subfolders, usually in compressed form. OPTIONS
The following options are supported: --add Ask for the name of the archive, then add the files, then quit the application. You can also use -a to specify this option. --add-to=archive Add files to the specified archive, then quit the application. You can also use -d to specify this option. --default-dir=folder Specify the default folder for the--add and --extract options. --extract Ask for the name of the destination folder, then extract the files, then quit the application. You can also use -f to specify this option. --extract-to=folder Extract archives to the specified folder, then quit the application. You can also use -e to specify this option. --force Create the destination folder without asking for confirmation. --help Display help text. You can also use -? to specify this option. --usage Display brief usage text. EXAMPLES
Example 1: Unpacking an Archive example% file-roller --extract archive EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/file-roller Executable for File Roller application. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNW | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
File Roller Manual NOTES
Written by Laszlo Kovacs, Sun Microsystems Inc., 2003. SunOS 5.10 29 Sep 2003 file-roller(1)
All times are GMT -4. The time now is 10:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy