Rsync command: Difference between revisions

From WikiMLT
m (Стадий: 3 [Фаза:Разработване, Статус:Разработван]; Категория:Linux Server)
mNo edit summary
Line 1: Line 1:
<noinclude><!--[[Category:Linux_Server|?]]-->{{ContentArticleHeader/Linux_Server}}</noinclude>
<noinclude>{{ContentArticleHeader/Linux_Server|toc=off}}{{ContentArticleHeader/Linux_Desktop}}</noinclude>
== References ==
== References ==


Line 22: Line 22:
* <code>-a</code> : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps
* <code>-a</code> : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps
* <code>-z</code> : compress file data
* <code>-z</code> : compress file data
* <code>-h</code> : human-readable, output numbers in a human-readable format<noinclude>
* <code>-h</code> : human-readable, output numbers in a human-readable format
[[Category:Ubuntu Scripts and Commands|3]]
 
</noinclude>
<noinclude>
<noinclude>
<div id='devStage'>
<div id='devStage'>
{{devStage  
{{devStage  
  | Прндл  = Linux Server
  | Прндл  = Linux Server
| Прндл1 = Linux Desktop
  | Стадий = 3
  | Стадий = 3
  | Фаза  = Разработване
  | Фаза  = Разработване

Revision as of 12:15, 4 August 2022

Ref­er­ences

Sec­tion 1

# Синхронизиране на музика със SD карта...
rsync -rv --delete --append ./ /media/spas/01CB-0E14

# Копиране през SSH
rsync --progress -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" pa4080-szs-vps:"/home/pa4080/SystemBackup/szs-vps-backup-${TODAY}.tgz" "$BACKUP_DIR"

rsync via ssh (source):

rsync --progress -vrazh <local-source> <ssh-host>:<remote-destination>
  • -v : ver­bose
  • -r : copies da­ta re­cur­sive­ly (but don’t pre­serve time­stamps and per­mis­sion while trans­fer­ring da­ta
  • -a : archive mode, archive mode al­lows copy­ing files re­cur­sive­ly and it al­so pre­serves sym­bol­ic links, file per­mis­sions, user & group own­er­ships and time­stamps
  • -z : com­press file da­ta
  • -h : hu­man-read­able, out­put num­bers in a hu­man-read­able for­mat