* From: Greg Wooledge <wool...@eeg.ccf.org> * Date: Mon, 12 Nov 2018 17:14:13 -0500 > Just put all the commands in one script, for example: > > #!/bin/sh > backup1 && > backup2 && > backup3
I was afraid you meant that. =8~) My three scripts are executed interactively. To my knowledge there can be only one script in a file. =8~| By defining chell functions, all three are in .bashrc. =8~) > Here's the backup script I use at home, ... OK, my first stage follows. ~/MY/ is an SD card. This Backup is executed when I finish editing something or finish enough editing that I wouldn't want to retype it after the flash store fails. It merely syncs from ~/MY/ into ~/MY0.Bak or, if executed with any parameter, to ~/MY1.Bak. Then it reports the size of MailMessages and the current size of the backup. Subdirectories, logs, voice messages, installer archives and similar non-essential data are excluded. Definitely more primitive than your backup. Comments welcome of course. The further two functions put the backup on a DVD-R. Done once per week or less depending on competing "essential" work, fatigue & etc. Can discuss these stages 2 and 3 later. Thanks, ... Peter E. ================================ Backup() { \ if [ $# -gt 1 ]; then echo "Too many arguments."; else echo "0 or 1 arguments are OK."; if [ $# -eq 0 ]; then echo "0 arguments is OK."; destination=~/MY0.Bak; echo "destination is $destination."; else echo "1 argument is OK."; destination=~/MY1.Bak; echo "destination is $destination."; fi; echo "Executing rsync."; rsync \ --exclude "*/" \ --exclude='AOS*' \ --exclude='Trap*' \ --exclude='*.WAV' \ --exclude='.aoshome' \ --exclude "lost+found" \ --exclude='*.Bak' \ --exclude='*.bundle' \ --exclude='*.iso' \ --exclude='*.mp3' \ --exclude='*.mp4' \ --exclude='pe' \ --exclude='*.sig' \ --exclude='*.webm' \ --exclude='*.zd' \ --exclude='*.zip' \ --exclude='*Libre*' \ --exclude='*Linux*' \ --exclude='Configuration.XML' \ --exclude='Oberon*Fnt' \ --exclude='Oberon.Text' \ -auv /home/peter/MY/* $destination ; /bin/ls -ld ~/MY/MailMessages; printf "du -s $destination gives "; du -s $destination; fi; } -- Message composed and transmitted by software designed to avoid the need, overhead and vulnerability of antivirus software. 123456789 123456789 123456789 123456789 123456789 123456789 123456789 Tel: +1 360 639 0202 +1 http://easthope.ca/Peter.html Bcc: peter at easthope. ca