Search code examples
rsync

ignore subdirectories timestamps when syncing from shell


i want to write a shell command to sync current directory to backup directory with some requirments. the command i'm using is:

   rsync -ptvHS --progress --delete-after --exclude /backup  $pwd ~/backup

i want the directory timestamps to be ignored, eventhough i use -t to preserve the file timestamps. Any idea? thank you in advance


Solution

  • From the man page:

        -t, --times                 preserve modification times
        -O, --omit-dir-times        omit directories from --times
        -J, --omit-link-times       omit symlinks from --times
    

    Seems like you need to add -O to your command.

    This is from rsync 3.1.2; you might find your version is too old.