Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Copy only modified files and new folder

  • 04-05-2009 9:03am
    #1
    Registered Users, Registered Users 2 Posts: 3,305 ✭✭✭


    Can anyone tell me how to copy one directory structure to another (Same layout and same name). All I want to do is to copy new or modified files and directories. If the dir exists then only update the files that have changed. Hope that makes sense?


Comments

  • Closed Accounts Posts: 12,807 ✭✭✭✭Orion


    rsync -update source destination


  • Registered Users, Registered Users 2 Posts: 1,183 ✭✭✭dioltas


    You could use unison (I think that's what it's called).


  • Registered Users, Registered Users 2 Posts: 279 ✭✭velocirafter


    rsync -av --delete <source> <backup>

    will copy only the updated files over and delete files in the destination that do not exist anymore in the source


  • Registered Users, Registered Users 2 Posts: 1,606 ✭✭✭djmarkus


    rsync -av --delete <source> <backup>

    will copy only the updated files over and delete files in the destination that do not exist anymore in the source


    man cp:

    -u, --update
    copy only when the SOURCE file is newer than the destination file or when the destination file is missing


  • Registered Users, Registered Users 2 Posts: 3,305 ✭✭✭irishguy


    Ill try them all thanks for the help


  • Advertisement
Advertisement