General :: Finding Files With Ctime Older Than X Seconds?

Jun 8, 2010

how to find a file with a ctime older than. let's say, 5 seconds? What I would like to do is to move all "new" files in a specific folder but not files that has not yet finished uploading.

View 1 Replies


ADVERTISEMENT

General :: Find One Day Older Files?

May 31, 2011

I used following command to sort one day older log files

Quote:

find /opt/TimesTen/tt_transaction_log/ -name "mtsDB.log*" -mtime +1 -print

following are log files which are existing, I have to delete one day older files from this location but when use above mentioned command it won't print one day older files, as i understand "-mtime" modified time, "+1" means one day older. am i correct?

Code:

-rw-rw-rw- 1 ablddb dba 268435456 May 30 17:11 mtsDB.log126985
-rw-rw-rw- 1 ablddb dba 268435456 May 30 17:17 mtsDB.log126986
-rw-rw-rw- 1 ablddb dba 268435456 May 30 17:23 mtsDB.log126987

[code].....

How can i print one day older logfiles?

View 3 Replies View Related

General :: Delete Files Older Than 1 Year?

Sep 24, 2010

Possible Duplicate:How do I delete files greater than a certain date on linux How to delete all files in current directory and it`s sub directories older than one year ?

View 2 Replies View Related

General :: Delete Files When It's Older 30 Days?

Jan 6, 2011

I am trying to put together ksh shell and I am new with writing scripts.How do you write a command to delete any files if it's 30 days old and also it's not currently being locked?

View 10 Replies View Related

General :: Delete Old Files Older Than 7 Days?

Sep 18, 2009

find -type f /path/* -mtime +7 -exec rm {} ;Is this the best way to delete only files (not directories) within /path that are older than 7 days? or is there a better way?

View 3 Replies View Related

General :: Deleting Files Older Than 1 Hours

Sep 8, 2009

on my site now I'm using cache and need me cron script that will delete files older than 1 hour I have feature in my kloxo control panel just need me the command .

View 2 Replies View Related

General :: List Files In Specific Directories Older Than 1 Day Or 24 Hours

Apr 7, 2011

I am trying to write a simple back up script in python where I try to list the files that are 24 hours old in specific directories that I would choose.I read the manual of find and used

find . -mtime 1 > log.dat

to get the list of files in the log.dat however I also get the path information in that list as such

./hpc06MatlabCodes/2011/Apr/3dBoxModel
./hpc06MatlabCodes/2011/Apr/3dBoxModel/vfluidIrca10.dat
./hpc06MatlabCodes/2011/Apr/3dBoxModel/vLRecoveredSystem.mat

is there a way to exclude the directories and only get the files list.

View 2 Replies View Related

General :: Command To Copy Files Older Than <n> Days Keeping Dir Structure?

Jul 6, 2010

I'm trying to truncate a postfix Maildata directory for one of our users. I want to be able to move any files older than <n> days to a new location, but also copying the relevant directory structure. This should be doable in the one comman. I've used find to locate the files, and mv to move them, but I can't figure out how to build the directoryt structure on the fly in the new location.

This is what I have so far:

Code:
find /Maildata/editor -mtime +42 -type f -exec mv -v {} /EditorEmailOld/ ; > ~/editor.txt

View 4 Replies View Related

General :: Bash - Command To Find Files Changed In Last N Seconds?

Jun 21, 2011

Linux command to find files changed in last n seconds. shell script,that we can run from cli or command.

View 3 Replies View Related

Programming :: Ctime() On Ut_tv.tv_sec Of Utmp Structure?

Jul 30, 2010

I'm using ubuntu9.10 (x86_64) and have some code,

Code:
void show_utmp(struct utmp* ent)
{
time_t tmp;
if (ent->ut_type != USER_PROCESS)
return;

[Code]....

View 8 Replies View Related

General :: Finding Files To Backup?

Mar 12, 2011

I have a situation where a directory has about 1.5 million files in it. On an hourly basis, I want to be able to find any files that have changed in the last hour, compress them, encrypt them and then copy them to both a local backup machine and an off site backup.

Is there any kind of utility or kernel module that creates some type of log of modified files? I know I can use find, but the search for -mtime in this directory takes quite a while and will not suffice for an hourly backup.

View 3 Replies View Related

General :: Finding All Files Starting With A .

Nov 29, 2010

To find all files recursively starting with a . (period), is the following OK:

find ./ -name '.'*

View 7 Replies View Related

General :: Finding Files Exactly 7 Days Old?

Apr 19, 2010

i am a newbie in linux ,i am writing a bash script to identify the files which are exactly 7 days ( a week old) i tried this command find /var/backup -mtime +7 -exec ls -d {} ;but this gives me even the files which are older than 7 days

[root@proxy access]# find . -mtime +7 -exec ls -d {} ;
./access.log.1.gz
./access.log.2.gz

[code]...

View 3 Replies View Related

General :: Finding Words In Files?

Apr 23, 2010

I am looking for this `struct messages_sdd_t` and I need to search through a lot of *.c files to find it.However, I can't seen to find a match as I want to exclude all the words 'struct' and 'messages_sdd_t'. As I want to search on this only 'struct messages_sdd_t' The reason for this is, as struct is used many times and I keep getting pages or search results.The directory I am searching in, has another directories so it will have to search recursively.I have been doing this without success:Code: find . -type f -name '*.c' | xargs grep 'struct messages_sdd_t'and thisCode: find . -type f -name '*.c' | xargs egrep -w 'struct|messages_sdd_t'

View 3 Replies View Related

General :: Finding A Script To Copy Files?

Nov 27, 2010

give me a script for copying all the files in a directory that are not directories to another directory. May be this could work:

Code:

FILE=(ls -l|grep ^-)
for i in $FILE
do
cp $i /destination/path/$FILE
done

View 14 Replies View Related

General :: Finding Files That Relates To Certain Applications

Jan 28, 2010

I'm wondering if you can share some tips in regards to finding .conf files in programs when installing using package managers. I'm scratching my head on the fact that when you install a program through yum/apt-get, I don't know what and where the software is being installed at. In Windows, I know that when it installs an application, it goes into the Program Files directory, it's that simple.I know Linux has predefined directories for applications but sometimes it installs configuration files in /etc or some other locations in /usr which I have a tough time sifting through.

Is there a way to trace what .conf or any files for that matter which relates to what software that needs it? It's just hard for me to understand what file relates to what application at the moment. As much as I would like to learn more about Linux, this process for me takes up alot of time. I hope you can help me out on this one.

View 1 Replies View Related

General :: Finding Files Under The Current Directory?

Oct 5, 2010

Assumed y directory structure looks as follow:

Code:

--root
-- dir1
-- dir1-1
-- dir2
-- dir2-1
-- dir2-2

And under each sub dir there are some log files ended with .log. Now I want to list all these log files. How to to that?

View 2 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

General :: Finding A Tool That Can Detect Glitches In MP3 Files?

Aug 24, 2011

My collection contains some MP3s which have some glitches like

displaying the wrong duration on loading
minor jumps
suddenly ending despite the duration claims another minute remaining
noise

I'm looking for a tool that can detect as many of these glitches as possible and fix those that can be fixed (obviously e.g. noise can not simply be eliminated in most cases).

View 2 Replies View Related

General :: Finding Website Links In HTML Files?

May 29, 2010

I have a website that has a massive list of royalty free stock photos and I want to download all of them. I have bought a membership for [URL] so I am able to download as much as I want from them for the next month.

Instead of going page by page and manually downloading each set of stock photos manually, I would like to automate this process. Here's my idea:

1. Download the website with the links to hotfile [URL]

2. Use grep to retrieve all the links to [URL]

3. Feed the links I recieve from grep into wget and download the works of them.

The problem I'm getting is when I use grep, It retrieves the entire line of html code where "hotfile.com" is shown. So here is an example of one link I receive in the output:

Quote:

./1776-santa-claus-vector-set.html:<div align="center"><a href="http://hotfile.com/dl/18418176/181a55b/Santa_Claus_Vector_Set.rar.html" target="_blank">HotFile</a></div>

Is there a way to just have the link shown in the output?

PS: I have everything else working, I just need an automated process of getting all the links.

View 5 Replies View Related

General :: Grep -- Finding Files That Contain Two Separate Strings?

Dec 9, 2010

I've got a quick grep question. I'm trying to work out a command I can use to locate all of the files in a directory that have sql database connection details. I want to do it by looking for the strings "localhost" and the name of the database.find . -type f -exec grep -l -E '^(localhost|DATABASE_NAME)' {} ;

View 4 Replies View Related

General :: Find Directory Older Than X And Mv Directory With Sub Files Command?

Jul 13, 2011

I'm quite new to linux but I have configured a simple ftp server and it's working great. I have a FTP-Shared folder with upload and download subfolders. Under upload's and download's I have identical category subfolders like mp3's, movies, software etc. in both. As the guy's upload, I would like to create a line crontab where I can move all the content under /FTP-Shared/upload/mp3/* older than 14 day's to FTP-Shared/downloads/mp3/ recursively (Like in cp command), but the timestamp must be searched on the first directory and not sub files example: /mp3/Club Dance/CD1/Hallo world.mp3This is how far I got:[root@clients ~]# /usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec mv -f {} /FTP_Shared/download/Mp3s/ ;This command moves the directory and files, but it is not recursively

View 4 Replies View Related

General :: What GUI Linux Programs Are There For Finding Files Based Upon Their Contents?

Sep 18, 2010

What GUI Linux programs are there for finding files based upon their contents?

View 5 Replies View Related

General :: Amarok - Collection - Scanning Is Not Finding Any Music Files?

Mar 13, 2011

I have been using Linux close to 2 years now. One thing that always bewildered me is audio support in Linux. These days I login to windows only for listening to music. After reading various blogs, i decided to give it a try in Linux with Amarok. There again I am facing a problem.

while i try to scan for music files it is not finding any files.

what I did is as follows:

Quote:

Setting --> configure Amarok --> collection --> scan

I have tried with mp3 .wma format files. While I try to add these files individually, Amarok is able to play those.

I am using Amarok 2.3.2 with KDE 4.4.5. Fedora - 12 is my flavor.

Given below is the log obtained with amarok -debug option

Quote:

TagLib: MPEG::Header:arse() -- First byte did not match MPEG synch.
TagLib: MPEG::Header:arse() -- Invalid sample rate.
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded
TagLib: A frame of unsupported or unknown type 'TSC' has been discarded

[Code].....

View 3 Replies View Related

General :: Finding Total Size Of All Files Whose Names Starting With A?

Jul 22, 2011

how to find total size of all files whose names starting with a

OS: SunOS

du -h a* is giving individual file sizes.

View 6 Replies View Related

General :: GUI Application For Finding / Deleting Duplicate Data Files

Jan 10, 2011

I copied a back up of my windows 'my documents' fold and all of its' sub folders into my linux (Mint Debian) Documents directory. I found that many of my files can be found in more that one directory so, what I want to do is to find all the dups and deal with them. Is there a good linux application to resolve this 'duplicates' problem. (I don't want to touch the linux system files.)

View 2 Replies View Related

General :: Finding A File Which Is Being Written Recently In Directory Of 1000 Files?

Apr 13, 2011

How to find a file which is being written recently in directory of 1000 files?

View 8 Replies View Related

General :: Bash Variable - Simple Script For Finding And Copying Files Powered By The Command?

Aug 2, 2009

Ive been using linux for a while but I am just getting into shell scripting, im currently trying to get a simple script for finding and copying files powered by the command:

Code:

This works fine from the command line but when put in a script such as:

Code:

Code:

with the keyboard inputs for $fc1 and $fc2 being *.doc and ~/test respectivly. The only problem i can see is the xargs -ivar "var" part possibly needing $var to be defined?

View 2 Replies View Related

General :: Finding A Recursive Shell Or Perl Script To Delete Files With The Same Name As The Parent Folder?

Jun 29, 2010

is there a recursive shell or Perl script to delete files with the same name as the parent folder? i wish to include the starting folder name as argument to the script.

View 2 Replies View Related

Programming :: Find Files Older Than X And Count Them?

Nov 29, 2010

I have log files that should be parsed and then deleted by a script on a regular basis. Sometimes things don't work for a variety of reasons and the log files sit and sit and are never dealt with. What I need is a small script that can give me the files older than X days and a count of those files.

What I have so far helps me take care of things manually but I need a little automation in my life Here is what I have: I can count all the files in the necessary directories recursively with this: ls -laR | wc -l And I can find all the files that are older than 10 days that haven't been deleted yet by doing this: find /home/mike/logs -type f -mtime +10 But how do I put both of them into a script that will just give me the end number of both?

View 5 Replies View Related







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