Tech Support Forum banner
1 - 3 of 3 Posts

·
Registered
Joined
·
60 Posts
Discussion Starter · #1 · (Edited)
Hi everyone

I need a command to select all files inside folder and subfolders created since the creation of a certain file xyz.txt .
Probably using the timestamp or something .

Can someone point me in the right direction ?

Best regards

I have tryed this:
Code:
OK - find -newermt "$(date -r rsyncLast +%F%t%T)" /xxx/client/dossier /zzz

OK - find -newermt "$(date -r rsyncLast +%F%t%T)" /xxx > filesToSync.txt

NOK - rsync -raz --files-from=( find . -newermt “$(date -r rsyncLast +%F%t%T)” ) /home/ubuntu/xxx/ /home/ubuntu/zzz/

Here's the entire story.

I need to syncronize with rsync folders/files and subfodlers between two places and remove the originals without deleting them (eventually adding a suffix that rsync can exclude on the next sync).
And i need to sync since the creation of a specific file.

My idea was the following.

1 - Create timestampfile names "rsyncLast" .
2 - Use rsync to sync files between two locations (same machine or diferente machines) .
3 - Remove the files from original folder and exclude the files from the next rsync .
 

·
Registered
Joined
·
60 Posts
Discussion Starter · #6 ·
The commandline can usually do a more granular search than a GUI app. The link below can get you started.

Linux Find Files By Date And List Files Modified On a Specific Date

If you prefer a GUI, take a look at 'catfish' or similar search app.
Almost Thank You

I have tryed the following:

Code:
OK - find -newermt "$(date -r rsyncLast +%F%t%T)" /xxx/client/dossier /zzz

OK - find -newermt "$(date -r rsyncLast +%F%t%T)" /xxx > filesToSync.txt

NOK - rsync -raz --files-from=( find . -newermt “$(date -r rsyncLast +%F%t%T)” ) /home/ubuntu/xxx/ /home/ubuntu/zzz/
 

·
Registered
Joined
·
60 Posts
Discussion Starter · #8 ·
Appreciate you adding 'the entire story.' Haven't used sync in years and not for what you're doing, so not familiar enough to refine what you've posted.


Too many unknowns to know what to suggest. Eg: how many originals are there, 20 or 200? How far down are the directories which contain the originals, and do their directory levels vary? Do you edit the originals and/or create new originals (which changes the Creation and/or Last Modified date)?

Perhaps, as you were thinking, start with renaming all the originals with a find/mv cmd? Or maybe moving all the originals to their own subdirectory? Either will allow you to exclude, delete and/or sync by name or location instead of by various creation/modified dates.

Searching 'rsync exclude files by name' and/or 'rsync delete files by location' will provide some better answers than my previous post.

Good luck.

Thank You
 
1 - 3 of 3 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top