Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:34:10+00:00 2026-06-14T20:34:10+00:00

i like rsync my photos from one (linux) disc partition to an other (backup

  • 0

i like rsync my photos from one (linux) disc partition to an other (backup location) using an shell script.
The problem is, that I need to re-scale all photos which are saved on the backup location, for example with mogrify.

Is it possible to post-process every file, which is synced/copied by rsync?
In oder to execute mogrify on every synced file?

An other way could using rsync (only) to generate the list of files which have to be synced. Next step: run a loop to mogrify every list entry in order to output the scaled photo to the backup location.

The problem is, that I have to add all the directories and child-directories to keep the original folder structure before saving the photo.

Using rsync would handle the folder creation “on the fly”.

So: is it possible to execute an command on every file synced with rsync?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:34:11+00:00Added an answer on June 14, 2026 at 8:34 pm

    rsync has a -i/--itemize-changes flag to output a resume of what it does with each file.

    I suggest you to play a bit with it, I’m seeing it outputs lines like >f+++++++++ file1 for a new file, >f..T...... file1 for an unchanged file, >f.sT...... file1 for an update, etc…

    Having that, you can read this output into a variable, and parse this with grep and cut:

    #!/bin/bash
    log=$(rsync -i rsync-client/* rsync-server/)
    newFiles=$(echo "$log" | grep '>f+++++++++' | cut -d' ' -f2)
    for file in $newFiles
    do
        echo "Added file $file"
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a standard gitosis setup that I would like to backup using rsync.
I've written a bash script on Cygwin which is rather like rsync , although
For example, I'd like to write a bash shell script to do rotating backups
I wrote like this Perl script.( /tmp/file is fuge) system(ssh host1 'rsync -av /tmp/file
I'm looking to rsync only specific files and directories from a cpanel backup to
I want to call rsync from Java using Runtime.exec() and I want to ignore
I am attempting to mirror a directory on a remote server using rsync. However,
I would like rsync to skip entire directories if they contain a certain file
I have a backup server which receives many rsync connections every hour. Since having
I use rsync to upload websites to a server. I use it something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.