General :: Find A Proper Command To Move A Certain Set Of Files According To Date/time Range?

Mar 18, 2009

I'm trying to find a proper command to move a certain set of files according to date/time range. I am thinking that the command should be something like:

Code:
ls -l | grep 'date/time range' | mv /folder

View 6 Replies


ADVERTISEMENT

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 :: Find All Files Modified In Date Range

Apr 30, 2010

I need to know all files modified within a date and time range.E.g: All modified files between 20 April 2010, 1100-1200 Hrs."find / -mtime +10 ! -mtime +11" :: this i found for date but how to include time as well.

View 2 Replies View Related

General :: Move To Previous System Date Using Command Line?

Sep 21, 2010

I want to know the command, so that i can move back two days i.e. all the changes i made during the two day is rolled back .

View 5 Replies View Related

General :: Extracting Date And Time From The At Command?

Sep 10, 2009

I would appreciate help with how to extract the date and time from at command jobs. From what I can tell, the date and time is embedded in the file name (/var/spool/atjobs).I'd be using this information in a (bash) shell script.

View 14 Replies View Related

Programming :: Search Of All Files In Computer Between Range Date?

Apr 13, 2011

I'm looking for a c++ code that search for all files in computer between two input dates (example- 3.3.2011 and 11.4.2011)and copy all file in that range in new file .the user run the program and input date and path in dos system

View 8 Replies View Related

General :: Script To Display Modified Date&time Of Files?

May 31, 2010

I am using the following script to creates list of accessed files.I like to add modified date and time of accessed files in the output.

For this what needs to be added in the below script??

#!/bin/bash
#
# creates list of accessed files
#
set $(date)
find /hdc160GB/programmers/projects -cmin -1440 > /hdc160GB/programmers/data/fileschanged/alert_$6-$2-$3.txt

View 7 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 :: Find And Move Files Greater Than 15GB?

Jan 23, 2010

I have a Ubuntu NAS set up with two 1.5TB in a mirrored array. We recently needed more storage and will constantly be adding to this machine. We added 2 2TB drives in a striped array. What I'd like to do is find all directories totaling 10GB+ on the mirrored array and move them over to the striped array to increase storage on the mirrored array for smaller, more important data. I've tried:

Code:
find /mirror -maxdepth 1 -size 10G
find /mirror -size 10

[code]....

View 2 Replies View Related

General :: Have A List Of Files, Move Them Using One Command?

Nov 2, 2010

I have run a command which finds a lot of files based on some search criteria. It returns the files like so:

./somepath/somepath/file.something
./asdf/asdf/s.php
./etc/a.php
./a/b/c/d/e/f/g.jpg

So I was wondering, if I capture this output into a file (ie. one file per line), can anyone help me write a command which iterates through the file and moves the files one by one to a specified directory?

View 3 Replies View Related

General :: Find Files With Specific Extension And Move To A Directory?

Apr 18, 2011

I need little help. I want to find all files with extension "*.tar" "*.gz" and "*.zip" and move all those files into "/opt/old" directory. I've tried this command:

Quote:

find . -type f -name "*.tar" "*.gz" "*.zip" -print0 | xargs -0 -r mv /opt/test

It's not working, something wrong after "mv" i guess.

View 10 Replies View Related

General :: Back Up Scrip - Find / Cp / Md5sum / Rm - Move All Files And Directories

Oct 22, 2010

I want to move all files and directories that are 1 month old out to back up into a separate folder. There will be a lot of files and I want to make sure it copies properly. The problem I'm having is integrating a MD5SUM into it to check integrity. MD5SUM is not recursive, so I figured it would work in a loop when it copies each individual file, I'll do a md5sum on each file and delete that md5 once its verified it copied ok.

[Code]...

I also need some sort of error handling to output all md5's that didnt pass the hash check.

View 3 Replies View Related

General :: Move 10 Files Of .dat Extention To .txt Using Single Command Or Script?

Nov 22, 2010

I have 10 files of .dat formatsayA MCDR .datB MCDR .datand so one upto 10 dat filehow i convert these 10 dat files to txt files using single command or script

View 6 Replies View Related

General :: Change A Files Modification Date "only" Without Changing The Time?

Oct 29, 2010

I'd like to change a files modification date "only" without changing the time. I'm aware of the 'touch' command but is seems like it only allows changing both the date and time, and not one of them. Any ideas on an easy way to change a file's modification date without also changing its time? (I have a long list of files and thus would like to run one to command to change them all)Example: Change a file's (month) timestamp from "2010-09-23 11:59:23" to "2010-10-23 11:59:23"Background: I accidentally set the wrong month on my camera and ended up with all photos having a modification timestamp with the wrong month.

View 3 Replies View Related

General :: Find/grep/wc Command To Find Matching Files - Print Filename And Word Count?

Sep 11, 2009

I am trying to do a find/grep/wc command to find matching files, print the filename and then the word count of a specific pattern per file. Here is my best (non-working) attempt so far:

wc `find . ( -name "*.as" -o -name "*.mxml" ) -exec grep -H HeightResizableList {}` ;

View 10 Replies View Related

General :: Command Line - Use Find To Find Text Files?

Jul 15, 2011

Is there a way to specify to find that I only want text files (and not binary files)? Grep has an option to exclude binary files, so I thought find probably has a similar feature, but I've been unable to find it.

View 2 Replies View Related

General :: Find Setuid Files Using FIND Command?

Jan 25, 2009

I know how to search for normal files but can you let me know " How to search for 5 setuid files on the system. Also explain, for each file, why setuid mechanism is necessary for the command to function properly"

View 1 Replies View Related

General :: Script To Find Files By Data And Time?

Aug 6, 2010

We have a script that FTP files 3 times a day, once ant 02:30, 04:00 and 13:00. Once the process runs it puts a copy of the file sent in the processed folder. What I'm trying to do is check to see if the files are there and if not send an alert /email. The file names are IVF_20100806_*.150, PLAZ_ 20100806_*.151, TRAN_20100806_*.152 and TRAN_20100806_*.151

This is what I have

#!/bin/ksh
#
. ${HOME}/.bash_profile
check_file()
{

[Code].....

View 2 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 :: Free Command Line Tool Time Which Can Be Used To Find Timing Statistics For Various Commands?

Jun 24, 2011

I'd like to measure network latency for SNMP GET request. There is a free command line tool time which can be used to find timing statistics for various commands. For example it can be used with snmpget in the following way:$ time snmpget -v 2c -c public 192.168.1.3 .1.3.6.1.2.1.2.2.1.10.2IF-MIB::ifInOctets.2 = Counter32: 112857973real 0m0.162suser 0m0.069ssys 0m0.005sAccording to the manual, statistics conists of:

the elapsed real time between
invocation and termination,
the user CPU time (the sum of the

[code]....

View 3 Replies View Related

General :: Find The No Of Files Cached At The Time Of Open & Loading Folder?

Feb 5, 2010

when we do enter on a folder it take some time for loading the folder depending on the no of entries in the folder . If the folder has more entries it take more time to load and if less no of entries then correspondingly less time . the delay in loading the folder varies due to reading of the folder entries in advance . SO what i want to know is that what is the MAX no of entries read in advance while opening a folder in linux and also how can we calculate this

View 4 Replies View Related

Ubuntu :: Copy And Move Files Over Two Systems All The Time?

May 14, 2010

I have to copy and move files over two systems all the time. So when I am on system 1, I simply use the command

Code:
$scp * system2:/some_directory

There are many files in PWD of system1 with different extensions. Of all the files in the PWD on system1, I don't need a file called *residual.dat as it it particularly big and wastes a lot of time copying.How can I make a shortcut so that every time I do scp, it copies everything but the *residual.dat file?

View 1 Replies View Related

General :: Move File And Folder Date Stamps?

May 7, 2010

I wrote this little script and I need some help, I am trying to achieve following:Every day I receive new file in the /home/denis/MyData/ folder and I don't know what the file mane will be but I want to move any file that arrives there to the new location /media/DataBackup/Linux/backup/ (media/DataBackup/ is external 500GB USB drive)to automatically create new folder with the date and time stamp every day and then to move content of the /home/denis/MyData/ into the new folder with current date stamp. So every day there will be new folder and will contain files for that day only.My script is as follows:

cd /media/DataBackup/Linux/backup/
mkdir MyData_$(date +%Y%b%d_%HH%MM)
#this creates file MyData_current date and time

[code]...

View 3 Replies View Related

General :: Search Within A Log File Within A Time Range

Jun 24, 2011

I want to search in my apache log, for events which have occurred say between 11:00 AM to 2:00 PM. I have got few scripts/commands but they are not conclusive, some of then are trying to do an exact match(awk) and for some i am just getting the pattern wrong (eGrep)

I am running RHEL.

Apache log eg:
================================================================
10.92.120.129 - - [24/Jun/2011:01:29:07 -0500] "GET /favicon.ico HTTP/1.1" 302
================================================================

now if i want to find out the logs from 1 PM to 2 PM

some example i had was:

cat <apache.log> | grep -E '07/Apr/20110[1-2]:[0-5][0-9]|02:00)'

small script in which i can pass the start time and end time range, and it should give an output of the rows which fall under that time range.

View 5 Replies View Related

General :: Find Command In Locate Pdf Files?

May 25, 2010

My goal is to find all pdf files on a remote machine, so I resort to the useful command find. So I type find .pdf or find .pdf" and I get nothing. I do the same on my machine and I get nothing. I do a regular search from the menu on my machine and I find quite a few pdf files. Would somebody please tell me what am I doing wrong?

View 5 Replies View Related

General :: How To Find Proper Codec For Xubuntu

May 20, 2010

I have just installed the Xubuntu. And I feel that to use it play a mp3 is like kill myself twice.

I try to play it with Exaile, the boxed player with Xbuntu. But it says I need to install some mpeg codecs.

I found so many depends with sudo apt-cache depends.

How to install them? one by one?!

View 1 Replies View Related

General :: Command To Find All Of The Files Which Have Been Accessed Within The Last 30 Days?

May 14, 2010

Command to find all of the files which have been accessed within the last 30 days?

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

General :: 'find' Command Regex To Exclude Hidden Files?

Jun 28, 2010

I have the following command which finds all files that have changed in the last day and lists them. How can I exclude hidden files like .bash_history?

View 3 Replies View Related

Ubuntu :: Find And Move Commands On Large Number Of Files ?

Feb 21, 2011

We recovered a large number of files from a HD I messed up. I am attempting to move large numbers of files of a type e.g. .txt .jpg , into a folder by type to more easily sort through them.

Here are the commands I have mainly been trying with various edits:

Code:

Code:

So far the most common complaint I have gotten "missing arguments to execdir".

This is on Ubuntu 10.04

View 6 Replies View Related







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