Advertisement
miamondo

rsync.sh

Dec 23rd, 2021 (edited)
1,525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.33 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Copyright © 2022 Benoît Boudaud <https://miamondo.org/contact>
  4. # This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
  5. # License as published by the Free Software Foundation, either version 3 of the License, or any later version.
  6. # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  7. # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  8. # You should have received a copy of the GNU General Public License along with this program.
  9. # If not, see <http://www.gnu.org/licenses/>
  10.  
  11. # ----------------------------------------------------------------------------------------------------------------------
  12.  
  13. # This script synchronizes four directories (Documents, Images, Musique, and Videos)
  14. # Feel free to add or to remove directories in the variable directories
  15. # This script takes one parameter which is the last number of the IP-address.
  16. # For instance ./rsync.sh 80
  17.  
  18. # ----------------------------------------------------------------------------------------------------------------------
  19.  
  20. directories=(Documents Images Musique Videos)
  21.  
  22. for d in ${directories[@]}
  23. do
  24.     rsync -avz --delete-after ~/$d $USER@192.168.178.$1:~
  25. done
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement