Server :: Rotating Files That End With A Date Stamp?

Oct 10, 2010

how I should go about rotating files that end with a date stamp. This is the configuration I have to rotate my Apache access files, but it is not working:

/var/log/httpd/access_log.* {
compress
daily
rotate 1
copytruncate
missingok
notifempty
}


The files are created with a date extension like the ones below:

[Code]....

View 6 Replies


ADVERTISEMENT

General :: Logrotate Not Rotating Files With Date Extension?

Oct 25, 2010

I am trying to configure logrotate on APP/DB servers.As per my backup policy,logs will compress in daily basis and and will be moved to a Central storage device.

My tomcat generate several application logs with date extension as well as .log extension.For eg app.log,app.log.2010-10-23-14,catalina.out,catalina.2010-10-25.log etc.

Currently my tomcat logrotation /etc/logrote.d/
#cat /etc/logroate.d/tomcat/
/usr/local/tomcat/logs/*log {

[code]....

But its rotating logs only with .log extension..ie app.log.2010-10-23-14 (with date extension) is not rotating.If i put "*" instead of "*log",its rotating all files including rotated files. How can i rotate files which is having date extension.Also i dont want to keep rotated logs for more than 3 days.

View 1 Replies View Related

SUSE :: Renaming Multiple Files - Adding Date / Time Stamp In Name

Feb 1, 2009

I am trying to rename multiple files in a directory and add the Date/Time stamp to the file name.

Example:
file1.txt
file2.txt
file3.txt

Renamed to
2009_02_01_21.txt
2009_02_02_21.txt
2009_02_03_21.txt

I am able to accomplish this using this command:
mv file1.txt "`date +%Y_%m%d_%H`".txt

But I want to automate this task, I have many files to process and I dont want to do them one by one.

I already tried this but it does not work
mv *.txt "`date +%Y_%m%d_%H`".txt

View 2 Replies View Related

General :: Copy To A New Directory And Rename With Date Stamp

Oct 25, 2010

Newbie 1st post here. Trying to find the most efficient way to copy a file to a different directory and rename it with a date stamp extension. Looking to accomplish this with one command if possible.

File = make_file
Full path /home/user1/bin/scripts/make_file

would like to move to the following directory /home/user1/bin/scripts/archive/

I'm trying to find out how to use command substitution along with the date command that when I copy the file to the archive directory it gets renamed with a time stamp extension. It should look something like "make_page_12:00:00-24-10-2010" I've tried a few different combinations using the cp and mv commands but can't seem to get it to work the way I want to.

View 3 Replies View Related

Ubuntu Multimedia :: Rename All JPEGs In A Folder By EXIF Date & Time Stamp?

Feb 24, 2011

In the Windows world where I came from, Irfanview freeware easily renamed a large folder of JPEG photos by EXIF time & date stamps, appending a unique number if the time and date stamps were the same. Is there an equivalent rename-by-EXIF information batch command in Ubuntu 10.04 Lucid? For example, change (based solely on EXIF information): FROM:DSC_0001.JPG TO:20110224_09:34:56am.JPG

View 9 Replies View Related

Ubuntu :: Pdftk Stamp Function - Stamp A Pdf Document

Apr 8, 2010

I've been trying to use the stamp function in pdftk. I'm trying to stamp a pdf document with a pdf I generate on the fly that contains the current date. Below is what I have so far. The problem is that pdftk says "Error: failed to open stamp PDF file". the file is in the same dir as execution, I've made it 776, I've specified full paths... nothing seems to work. I've even tried the "prompt" option and specify it manually but I get the same behavior. This is pdftk version 1.4.

Script (named "go"):
Code:
# date in YYYY-MM-DD format
umask 0
# create a variable with a formatted date
TODAY=`date +%Y-%m-%0e`;
[Code].....

View 3 Replies View Related

General :: Create A Script That Will Look For A "filename" Under /etc/, Date Stamp The File And Copy It To /var/www/upload?

Jul 14, 2011

I'm trying to create a script that will look for a "filename" under /etc/, date stamp the file and copy it to /var/www/upload

View 5 Replies View Related

General :: Copied Files In Nfs Does Not Show The Right Time-stamp?

Mar 3, 2011

I have two systems running on linux. system one is running with RHEL 5.4/X86_64 hardware, system two is running with RHEL 5.3/i686 hardware. One filesystem is shared from system two and mounted as NFS on system one. Now when i do a copy from local filesystem to the NFS share from system one,it shows as follows

Quote:

-rw-r--r-- 1 xkinved rbak1 30 Mar 3 2011 king

But if i do copy with -p option then it shows right time stamp. Both machines are running with slight(minutes) different in time. Does this could be cause for this problem? The problem is happening while i do FTP from some other machines too.

View 3 Replies View Related

Ubuntu Servers :: Apache2 Log Files Not Rotating?

Mar 29, 2010

I can't get my apache2 log files to rotate on an Ubuntu 8.04 64-bit server install.

Does anybody know of logrotate creates an error log somewhere by default?

Here's my /etc/logrotate.d/apache2 file if someone has any insight if I am doing something wrong.

/var/log/apache2/*.log /var/log/apache2/portal/*.log {
weekly
missingok
rotate 52
nocompress

[Code].....

View 9 Replies View Related

Networking :: Rotating Capture Files Using Tcpdump?

Apr 6, 2010

I would like to set up tcpdump to rotate log file every 1 hour and retain files for the lat 14 days but I don't think any combination of -C and -W would allow me to do that (Atleast I haven't been able to figure it out), so I am trying to rotate the files every X number of MB and retain the last 20 files. This seems to be fairly simple with the '-C X -W 20' option but I am having some trouble in customizing the names of the log files. I have tried '-w capture-$(date +%Y-%M-%d-%H:%M-)' thinking that each file would start with the current date and time but all files are using the date and time when the capture was started so the only difference is the number at the end (which is done by -W). if I can customize the names of the file so that it has the date and time when the capture in started. In fact if I can do that, I dont need the numbers that '-W' appends at the end but I dont know how to get rid of them.

View 4 Replies View Related

Ubuntu Multimedia :: Replace Jpg Files Last Modification Date With Timestamp Creation Date?

Sep 22, 2010

I'm looking for a method for modifying some jpg photo files last modification date with the corresponding timestamp creation date of each file.The reason is that shotwell import pictures in folders according to last modification date which is stupid on my opinion.

View 2 Replies View Related

Programming :: Using Bash Script To Purge Rotating Tcpdump Files?

Oct 20, 2010

writing a script that would keep the last three versions of tcpdump files.Due to the version of tcpdump I must use -C and cannot use -G. Using -C generates a new file after X MB's have been written and adds a .x after each new one. The problem is that these files are filling up the disk too quickly. The main part of the script will kill tcpdump when a certain condition is met but in the meantime I need to purge and only keep say the three last iterations of the dump file. So for example, there is dump.pcap.1, dump.pcap.2, dump.pcap.3, dump.pcap.4 and dump.pcap.5. I'd like the script to look at the datestamps and delete dump.pcap.1 and dump.pcap2 since the other three are the three newest files. comparing files based on dump.pcap.*, check the dates and only keep the three 'youngest' files?

View 5 Replies View Related

Server :: Rotating Logs In Squid 2.7 Stable9

Aug 13, 2010

I've installed squid 2.7 stable9 in centos 5.4 x32 bit. I've installed and configured it successfully, its working fine. I want to clear few doubts, for that your kind help is needed. Parallely, I've configured another server using binary rpms with same squid version (2.7 stable9). I found that it creates a /etc/logrotate.d/squid for rotating log files (access.log, cache.log, store.log). Which is properly rotating log files using compress, dateext and size options (i manually added the size option).

But after compiling and installing from source code, its automatically not created. I want to rotate the log files in the same way as it is doing when i install using binary rpms. Below logfile_rotate entry is present in my squid.conf file (in source code installation scenario) logfile_rotate 10 Below logfile_rotate entry is present in my squid.conf file which is commented (in binary rpm installation scenario) #logfile_rotate 10 I want to rotate the log files by size (as I've more than 200 users, these logfiles size increasing very fast, ie. approx 80 MB per hour), with compress and dateext option.

View 3 Replies View Related

Server :: Logrotate Rotating Daily When Should Rotate Weekly?

Mar 18, 2010

I have an Ubuntu server, and I have a special script on logrotate.d to rotate the samba_audit logs:

/var/log/auditsamba/auditoria.log {
weekly
rotate 12
missingok

[code]....

View 14 Replies View Related

CentOS 5 Server :: Rotating Named Logs Via Syslog.conf?

Mar 1, 2010

OS CentOS 5.4 I have a DNS server that is logging all named and dns requests to the chrooted named directory. By default named logs to /var/log/messages but I want to isolate all the dns queries and requests to separate files. I know I can add entries to /etc/syslog.conf to "roll" the logs and logrotate should pick them up but fuzzy as to the syntax. I don't know what "tag" to use in the first fieild. for example

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none/var/log/messages

Here is the logging section of my named.conf

# pwd
# /var/named/chroot/etc
logging
{

[code]....

View 5 Replies View Related

Software :: Application To Eliminate Doubles In Files / Rename Changed Files With Date?

Jan 12, 2011

I have bought an external usb hard drive on which I back up my three computers every once in a while.Space will quickly be used up.I can't find that little bit of research that I need yesterday.Here is what I would like to find:An application that eliminates doubles in identical files and renames files that have changed by appending the last saved date yyyymmdd to the file name.Does such an application already exist?

View 6 Replies View Related

Ubuntu :: Show Date And Size Of Files During Files Replacement?

Jan 16, 2011

I am newer to Linux ( using Ubuntu 10.04) : I have noticed that during replacement of a file , no date and size of the new and old files are shown in the dialogue box so how to show that ( like the one in windows)

I know that it is easy question , but i really don't know how to do that , by the way I have checked folder preferences and system --> preferences but i did not find something for that

View 9 Replies View Related

Programming :: Sort Files In Directories Based On Files Date

Sep 8, 2009

I need a script that will take all the files in a given directory and create new monthly sub-directories and sort all the files based on the creation date into the appropriate directory.For example, all files created between 01/01/09 and 01/31/09 will be placed in 'JAN-2009'

View 5 Replies View Related

General :: Deleting Files By Date

Nov 5, 2009

I had a program run riot and it has created hundreds of spurious files in one directory. Fortunately they are all dated 4th November so are easily identified. What bash command can I use from the console to delete them all?

View 2 Replies View Related

Software :: How To Get Current Date Log Files

Mar 13, 2011

Currently I'm using `ls -l | grep "Mar 13" ` for listing today log files.Output :-rw------- 1 root root 2188192 Mar 13 10:33 audit.logBut my requirement like below,note permission,date,size...audit.log Note : Where 10 logs file are same directory in different date , But I'm looking files which are logging in today date (Mar 13)

View 2 Replies View Related

Fedora :: Rename JPG Files To Creation Date

Sep 2, 2009

I have a list of .jpg files from two cellphones that I would like to rename to the file creation date... but so far I can't seem to find a suitable script (or anything remotely close to what I need).

These are jpg's snapped on cellphone cameras, so no EXIF data exists.

View 4 Replies View Related

OpenSUSE :: View Files By The Date At Which Last Accessed?

Jun 30, 2010

Is there a way (I'm on kde) to view files (hopefully in dolphin but I'll take anything) by the date at which they were last accessed?

View 7 Replies View Related

General :: Untar And Only Extract Those Files That Are Above A Certain Date

Jun 16, 2010

Is there any way to untar and only extract those files that are above a certain date including directory structure??

I restored a backup on a play server but it was a few days old. However I have a tar archive of the entire structure that is more up to date and healthy so now I want to extract all files (including directory structure) based on a date filter on the files if possible?

View 2 Replies View Related

Ubuntu :: List Files By Creation Date?

Aug 19, 2010

I'm looking for a terminal command that gives me the latest created folder in a directory tree.

Code:

ls -lR --sort=time --reverse

this i almost good, but a) it gives me files (rather than folders only), b) it sorts the files by folder (rather than just giving me a plain list of everything) and c) it takes way to long.

what i want:

Code:

2010-08-01 ./path/to/folder/a
2010-08-03 ./path/to/folder/b
2010-08-06 ./another/folder/c

[code]....

View 9 Replies View Related

General :: Copy Files Revised After A Certain Date?

Feb 15, 2011

I am running ubundu 10.10 and want to copy all files revised after a certain date (01.02.2011) to a certain location (usb memory stick) for backup purposes. How do I use the "cp" command, or do I have to use any other command ? Or may be this is not possible in Linux ?

View 1 Replies View Related

General :: Find Files In Date Range?

May 31, 2010

ls -l /tmp/empty_file*
-rw-r--r-- 1 root root 0 2010-05-30 08:00 /tmp/empty_file
-rw-r--r-- 1 root root 0 2010-05-30 12:00 /tmp/empty_file1

This looks good, the files expected to be seen are output: find /usr ( -newer /tmp/empty_file -a ! -newer /tmp/empty_file1 ) -print

But this shows me files that should not be output and likewise when I replace ls with tar it is tarring a whole bunch of stuff I do not want: find /usr ( -newer /tmp/empty_file -a ! -newer /tmp/empty_file1 ) -exec ls -l {} ;

In the end I would like to replace the "ls" with "tar cvvfp some.tar {} ;", but can't figure out what is going wrong here.

View 2 Replies View Related

General :: Rsync Files With Dates After A Certain Date?

Jun 8, 2010

I was going to do a rsync -r -a -z -v -p -e sshto move some files frome server to another, but then realized all I really need are files which have dates starting June 1, 2008 to current. Is there a way to have rsync only sync those files?he directory structure that's my source goes all the way back to 2004.

View 5 Replies View Related

Fedora :: Automatically Renaming Files While Sorting By Date?

Apr 17, 2010

I often record music from the webradio with Streamtuner.How can I rename the mp3 files recorded in a way that numbers are added to the beginning of the filename representing the order in which the titles were played on the webradio station?I am looking for an automated solution like a renaming tool since there are usually hundreds of files in a directory. I used autorename / ARen for windows back in the day when I was still on XP. What I could do with the tool was:a) Sort the files by date of creationb) add an increasing number at the beginning of the filename based on the position in the sorted list.

View 3 Replies View Related

General :: Finding Files Based On Date Without Using `find`?

Aug 11, 2011

I know find can do what I am looking for, but I am wondering if there is an alternative way to find files on the filesystem either created before/after a certain point, or at a certain time.

Typically I rely on updatedb & locate for most of my file searching needs. Issues with those tools, though, are that it only has directory and file names, and it only creates a database of local directories, not anything mounted via CIFS|NFS or via -o loop (eg, .iso images).

So if I need to find files created after yesterday across the entire system (local and remote filesystems), I am currently needing to use find.

What other tools, if any, would accomplish this in a similar fashion?

I have tried ls and grep, but that requires (in my attempts so far) multiple searches:

ls -lR | grep Aug | grep 10
ls -lR | grep Aug | grep 11

View 6 Replies View Related

Ubuntu :: Backup NTFS Files Modified After A Certain Date?

May 14, 2010

I clone my entire notebook hdd once a month to a USB drive with an identical disk once a month using dd. I would like to find a way to automatically or manually do incremental backups at shorter intervals.

The first problem is that my incremental backup drive is not the same as my full backup drive (which is my clone). Is there some way to backup or copy all files on a document partition modified after a certain date?

The second problem is that my document partition is NTFS-3G. I guess this could be done pretty easily using "dump" if I stored my docs on ext. [I don't because I want to make sure that my docs are accessible from any machine (say in an Internet cafe) should my MacBook die and I need to rip out the hard drive and run to do my homework on another system; that is why I keep my docs on my Vista partition].

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved