<div class="gmail_quote">On Mon, Oct 24, 2011 at 6:41 AM, Wipe_Out <span dir="ltr"><<a href="mailto:wipe_out@users.sourceforge.net">wipe_out@users.sourceforge.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<div><br></div><div>I am trying to keep a directory with only the files that have changed in the last 30 days (nothing earlier).. I am trying this command..</div><div><br></div><div>find /mnt/Scheduling/ -type f -mtime -30 -exec cp -r {} /home/ftpuser/attendance_registers/ \;</div>
<div><br></div><div>I have tried with and without the "-type f" option but it only copies the files from all directories of the source to the root of the destination.. Even using "cp -r" made no difference because obviously find is just passing the filename to the cp command..</div>
<div><br></div><div>rsync is no good because I can't limit it to getting files that have changed in the last 30 days only..</div><div><br></div><div>Anyone have any suggestions how I can replicate the directory structure as well?</div>
<div><br></div><div>TIA</div>
<br>--<br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br>
<br></blockquote></div><br><br>Doesn't the -a option do that ... <div><br></div><div> $ find . -mtime +30 -exec cp -av {} $dirname/ \;<div><br></div><div>That seems to work on my system. <br><br clear="all"><div><br>
</div>-- <br>Hal<br>
</div></div>