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


ADVERTISEMENT

General :: Parsing File Dates - Get The Date Of The Last Time A File Was Modified ?

Jan 11, 2010

I need to get the modified date on a file in linux to use in a script.I tried using 'ls -l' on the file, but this caused problems when the date turned from a single digit into a double. The reason for the problem was because I was parsing the result string on spaces.How can I get the date of the last time a file was modified so I can use it in a script? For example, if a file was modified on 1/11/2010, I need the 11.

View 2 Replies View Related

SUSE :: Get All Month Start And End Date Between Two Dates?

Dec 22, 2010

I have a requirement where I need to write to a file a block of static text for each month starting from 01-01-2000. It would be something like below

[code]...

View 2 Replies View Related

General :: Script To List Deleted Files With Dates?

Mar 29, 2011

I created a script to move files to a "trashbin" This is my code:

Code:
mv $1 /home/giovanni/trashbin
echo "$1 Deleted"

[code]...

View 13 Replies View Related

Software :: Use "date" To Calculate Some Dates?

Aug 6, 2009

I'm trying to use "date" to calculate some dates. I'm getting some wrong results and wonder, if I'm doing something wrong here. If someone has any idea or if your "date" works as expected, please post here. In case it works on your machine could you please tell me which version of coreutils you have installed? The example code I'm using follows. I first create a date, which should switch to a previous day if I substract some minutes. The code and the results I get:

Code:

bash-3.1$ REC_YEAR=2009
bash-3.1$ REC_MONTH=9
bash-3.1$ REC_DAY=1
bash-3.1$ REC_HOUR=0

[code]....

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

Software :: Run Rsync To Download Files From A Server Without Rsync Daemon?

Sep 18, 2009

I just tried to sync files from one server to another. After the sync process, I found the files are bigger than original ones.

I looked up the web and found someone mentions the rsync daemon. So I have to run the daemon on one server before I run the rsync?

The command I used is rsync --partial --progress -r source destination

View 1 Replies View Related

Server :: Rsync Can Not Rsync Files With Include Filter

Jul 21, 2010

use rsync to cp such files and dirs under /var/www/html/mydir directory but these two files(/dir4/1.html /dir4/2.html) cant rsync to dest mechine.

rsync configure file,below...

View 2 Replies View Related

Slackware :: Using Rsync To Keep Local Copy Of Stable Tree Up To Date

May 14, 2011

when I installed 13.37 I created a local copy of the entire stable tree (source/ and all the rest) just to have all that stuff around to browse offline.

Now, to instruct myself, I'm trying to use rsync to keep this stuff up to date. But I seem either to have misread the rsync man page or ... well, I don't know. I am issuing the following command and getting the results seen below:

Code:

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

General :: Rsync Would Keep Sending The Files Over And Over Again?

Mar 2, 2010

I'm trying to using rsync to backup some files, about half a TB. It's now it a state where it keeps sending the same files everytime it runs. for example:

rsync -av /data/source/* user@host:/data/dest
sending incremental file list
source/file1.txt
source/file2.txt

I then verify those files are copied over. then the next time it runs it does the same thing

rsync -av /data/source/* user@host:/data/dest
sending incremental file list
source/file1.txt
source/file2.txt

any idea why it's getting stuck on these files? I've tried to wipe the whole dest directory out and start over but no luck.

View 2 Replies View Related

General :: Rsync Only Newest N Gb Of Files?

Jul 27, 2011

I have two directories, dirA whicht contains N gb of data and dirB which is supposed to contain only the newest M gb of data from dirA. When files are added to dirA, they sould also be added to dirB, while the oldest files in dirB should be deleted.Is that possible with rsync? or any other software?

View 1 Replies View Related

General :: Rsync With Scp - Copies Everything - All Files

Jul 12, 2011

rsync -r -v -e ssh root@nn.nn.nn.nn:/usr/local/websites/* /usr/local/websites and each time I run it it copies everything - all files. I thought rsync was only supposed to copy files that had been added or modified.

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

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 N Newest Files In A Directory?

Nov 8, 2010

What would be the easiest way to go about rsyncing the n newest files in a directory to a remote server?

View 2 Replies View Related

General :: Rsync Not Deleting Files On Target

Sep 8, 2010

I'm using the command below to sync two directories. Problem is insted of deleting the files on the target directory it simply appends a ~ character at the end of the file name. Not sure why this is happening?I'd like to have all deletes on the source replicated on target.

View 2 Replies View Related

General :: Rsync, Crontab And Backing Up Files?

Apr 11, 2011

This is a quick one, I don't have any problems yet, I just want to check that this is going to do what I think it is. I added the line

Code:
00 01 * * * rsync -avz --delete /local-storage /mnt/usbackup
to my crontab file, am I to understand that this will backup /local-storage to my external

[code]...

View 4 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 :: Adding A Files Creation Date To It's File Name?

Sep 17, 2010

I have some basic experiencing creating simple scripts/making directories/changing permissions/etc. but I'm stumped on this one.

I have two linux boxes. I have a script set up on box 'A' to SCP into box 'B', grab a copy of a database backup and store it on box 'A'. It looks like this:

scp root@X.X.X.X:/blah/blah/blah/dump.23.gz /home/blah/DB_Backups/

I have generated a public key on box 'A' and placed it into the authorized_keys file on box 'B', so a password is not required and the file copies over successfully when the script is run. On to my problem...

I need to know what date the 'dump.23.gz' file was originally created when I'm viewing it after it's been copied to box 'A'. If I ls -l on box 'A' it only shows me the date it was created on box 'A' when it was copied.

What would I need to add to my script to append the backup's original creation date on box 'B' to the filename so that when it gets copied to box 'A' I know when the backup was created on box 'B'. I'm sure this is probably confusing. I've done lots of searching and can only find information on how to append the current date and time to a file name. I need to append it's original creation timestamp to the filename when it copies over.

View 10 Replies View Related

General :: Copying Files According To Modification Date And Extension?

Dec 30, 2010

I am trying to find a command which will copy all the files in the folder with extension ".log" which is created one day before the current date. By going through other threads in this forum I found the half solution to this problem

find /mnt/hd -mtime -1 -exec scp {} /mnt/usb ;

This command copying the all the files created one day before(not only *.log) to the /mnt/usb folder. what is the modification required to above command.

View 5 Replies View Related

General :: Delete Files In Folder Before Todays Date?

Sep 14, 2009

I currently have a command to backup a directory it will zip the directoryand place it where i have told it too, Now what i am after is a command i can run before my code, that will delete and tar.gz files before todays dateso i my ideal world it would be something like this, delete <'date +%m_%d_%y'.tar so this will delete all the files in this folder before todays date,

View 1 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 :: Write A Script That Searches Files By Date?

Jul 26, 2011

I'm trying to write a script that searches my files and lists them by date. Can someone point me in the right direction? I've been looking through the books that i have but i'm just not finding the right commands to search dates.

View 7 Replies View Related

General :: Copy All Files And Folders From Specific Date?

May 26, 2011

I wanna copy all folders and files created from 01.01.2011 until today to new placeie:cp -r /home/moviecar/public_html/wp-content/uploads/ /home/teaser/public_html/wp-content/uploads

View 4 Replies View Related

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

General :: Merge Files By Creation / Modification Date?

Oct 4, 2010

I have a folder with hundreds of .txt files (logs of some java application) that I have to merge in to one single .txt file. This application produces a new log file everyday:

day1: logFriday10September2010.txt
day2: logSaturday11September2010.txt
...
day8: logFriday17September2010.txt
...
and so on...

I could merge the files easily with "cat" and ">>" however, the problem is that I have to do it by taking into account the date (creation or modification) of the file.

If I simple use the cat command the output file will receive for example, all Fridays in a row, then all Saturdays, etc. and in that way I'm not considering the date.

I've searched for the options of the find command, since the files after creation are not modified...I try to use this for example:

$ find . -newer <some old file>

but that lists me all files after that <old file> and not by correct date.

View 5 Replies View Related

General :: Order Of Transfer All Files Under A Directory By Rsync

Sep 25, 2010

If transfer all files under a directory by rsync, what is the order that rsync determines to transfer the files one by one?At first it looked like rsync transfers files in alphabetical order, but later I found rsync skipped some files in the first sweep through the alphabetic order, and then went back to transfer files that were skipped in the first time and this time still in alphabetic order.

View 1 Replies View Related

General :: Rsync And Making Sure All Files Have Been Transferred Before Applying The Changes?

Nov 15, 2010

I was wondering if there is a way to tell rsync to only apply changes (delete, overwrite,create) only if all files in the file list transferred successfully.Just to clarify, this would essentially be putting a transaction around the transfer.

View 3 Replies View Related







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