How to copy all structure folder create last day?

HI All,

please help , i got same case . i want copy folder and directory create yesterday.

for sample below :

drwxr-xr-x 4 apps apps    33 Nov 23 04:00 xxxxxx@gmai.com
drwxr-xr-x 4 apps apps    33 Nov 23 04:00 yyyyyyy@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 04:00 aaaaaa@yahoo.com
drwxr-xr-x 4 apps apps    33 Nov 24 04:00 bbbbbbb@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 04:00 ccccccccc@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 20:01 dddddd@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 24 20:03 eeeeeee@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 26 13:10 fff@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 26 13:10 gggggg@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 27 04:00 hhhhhh@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 28 04:00 iiiiiii@gmail.com
drwxr-xr-x 4 apps apps    33 Nov 29 04:00 jjjjj@gmail.com

pwd

/home/doc/user

and i want copy all folder directory create yesterday but actually in structure directory have some folder create different date like sample below :

pwd

/home/doc/user/jjjjj@gmail.com/doc
ls -ltr
total 0
drwxr-xr-x 2 apps apps 34 Oct 17 15:15 ID
drwxr-xr-x 2 apps apps 34 Oct 17 15:15 CARD

and i want copy all folder create yesterday include structure directory...

i already try with this command below but not spesified name folder got for yesterday create :

find /home/doc/user/ -mtime -1 -exec ls -ltr {} \; 

please help , thanks

Hi,
On most file systems, there is no tag on the creation date...

Regards.

One problem you might have is that any update to the directory members (e.g. create new file, rename file, delete file etc.) will update te timestamp of the directory. You need to be clear in your design, else it will go wrong. There is no create date attribute. You may have to schedule a daily job to record that yourself. Overall though, do you want to:-

  • Copy the directory if it was created on a particular date
  • Copy the directory that was modified on a particular date
  • Something else perhaps?

The distinction is on the file/directory attributes. You can tell when a file was last accessed (probably not relevant) changed or modified. A change includes created, permissions changed etc. Modified is the content of the file. In the case of a directory it is changes, but not modifications to the files it contains, so the directory is modified if a chmod is run on a file it contains. If the content of the file is modified, then the directory remains the same.

Which case fits your need? If you need to know what directories are created since your last run, you would probably need to create a history file to tell you what you had and find anything new.

Kind regards,
Robin