#!/bin/bash for directory in "P1" "P2" "P3" "P4" "P5" "P6" do rsync -avzp --delete-during /datas/${directory}/ ./${directory}/ done