Results 1 to 6 of 6

Thread: How to only copy newer files from one location to another location

  1. #1
    Join Date
    Dec 2011
    Beans
    33

    How to only copy newer files from one location to another location

    Hi all,

    I'd like to back up the important programs. say, all my programs are in a folder named MAT1 (which is about 20GB), I copied this folder to another disk every time, also named MAT1.

    The problem is that: most of the files in these two folders are the same, is there any simple way to only copy newer files to the backup folder?

    Thanks.

    Mike

  2. #2
    Join Date
    Oct 2011
    Location
    ZZ9 Plural Z Alpha
    Beans
    Hidden!
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: How to only copy newer files from one location to another location

    IIRC Nautilus can discern file age and will prompt you accordingly when copying. You can also use

    Code:
    cp -u
    Which, from the cp man page "copies only when the SOURCE file is newer than the destination file or when the destination file is missing"
    Last edited by cortman; September 29th, 2012 at 03:09 AM.
    GNU/Linux Notes || Linux Command Line Learning Resources

    Copy.com offers 15 GB free cloud storage plus 5 GB for both of us when you follow this referral link.

  3. #3
    Join Date
    Feb 2011
    Location
    Somewhere...
    Beans
    1,543
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How to only copy newer files from one location to another location

    There's rsync, a very powerful command line tool used to backup files. Usage:
    Code:
    rsync -av --delete /source/folder /source/folder/no/2 /source/folder/no/blabla /destination/folder
    With this command, all files from /source/folder, /source/folder/no/2, and /source/folder/no/blabla will be copied to /destination/folder, but only the newly modified files. Also, the --delete flag will delete files in the destination that are no longer in the source.

    (If you want graphical, use grsync)

  4. #4
    Join Date
    Aug 2011
    Beans
    322
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: How to only copy newer files from one location to another location

    rsync will do the job for you. It should already be installed. Check the man page (man rsync). If you want a full backup system take a look at rsnapshot which is based on rsync.

  5. #5
    Join Date
    Nov 2008
    Beans
    Hidden!

    Re: How to only copy newer files from one location to another location

    Rsync is part of the default install and there are several GUI's available for it.

    Two that I like:

    http://www.opbyte.it/grsync/

    http://luckybackup.sourceforge.net/

    Both are in the software center

  6. #6
    Join Date
    Dec 2011
    Beans
    33

    Re: How to only copy newer files from one location to another location

    thank you all guys. learning new stuff, hahah.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •