I'm currently using rsync
on a script that deploys a PHP application from a staging to a production server. Here is how:
rsync -rzai --progress --stats --ignore-times --checksum /tmp/app_export/ root@app.com:/var/www/html/app/
This is currently outputting a list of every file that's being compared (every file in the project), but I'd like it to output only the modified ones, so I can run it with a --dry-run
option to check that every deploy is updating only the desired files.
NOTE: The best I could do so far is grep fcst
the results, but I'm looking for an rsync
option that I'm sure it's there but I can't find it in the man pages.
Thanks in advance!
Best Answer
If there's an rsync option to do exactly what you're asking, I didn't find it in the manpage either. :-)
That said, I don't see the problem with grepping the output of
rsync -i
to parse out exactly what you need. That feels nice and Unixy to me.One nit-picky quibble with your rsync command: the
-r
is redundant, as it is implied by-a
.