Skip to main content

Thread: How to setup my rsync in a script


hi all

use rsync on commandline @ moment. execute 5 rsync's 1 click, , possibly automatically shutdown computer. how can this?


commands doing following (the last 2 go nfs-share on nas)

rsync -r -t -p -o -g -v --progress --delete --exclude=.* --log-file=/home/roberto/i3vmssd.txt --log-file-format= -l -h -s /media/i3vmssd/i3vmmint /media/vmandimages/vmandimages/vm

rsync -r -t -p -o -g -v --progress --delete --exclude=.* --log-file=/home/roberto/homei3host.txt --log-file-format= -l -h -s /media/homei3host/roberto /media/homei3hostbk

sudo rsync -r -t -p -o -g -v --progress --delete --exclude=.* --log-file=/home/roberto/vmandimages.txt --log-file-format= -l -h -s /media/vmandimages/vmandimages /media/vmandimagesbk

rsync -r -t -p -o -g -v --progress --delete --exclude=.* --log-file=/home/roberto/homei3hostdatanas.txt --log-file-format= -l -h -s -b --backup-dir=`date +%y-%m-%d` /media/homei3host/roberto /media/datanas

rsync -r -t -p -o -g -v --progress --delete --exclude=.* --log-file=/home/roberto/vmandimagesdatanas.txt --log-sudo file-format= -l -h -s -b --backup-dir=`date +%y-%m-%d` /media/vmandimages/vmandimages /media/datanas

can put in file starting "#!/bin/bash" , ending last command?

thanks
roberto

that reasonable starting point script.

if want shut down @ end, like:

code:
sudo poweroff
you might want define variables refer directories , common options it's easier maintain, example:

code:
rsync_options="-r -t -p -o -g -v --progress --delete"  vm_images="/media/i3vmssd/i3vmmint /media/vmandimages/vmandimages/vm"    rsync $rsync_options --exclude=.* --log-file=/home/roberto/i3vmssd.txt --log-file-format= -l -h -s "$vm_images"  ...


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support New to Ubuntu [ubuntu] How to setup my rsync in a script


Ubuntu

Comments

Popular posts from this blog

Some mp4 files not displaying correctly (CS6)

Thread: Samba is not authenticating with LDAP