Cron backup script
by alex4buba from LinuxQuestions.org on (#6FCDG)
Hello friends,
My desktop PC died and I installed KDE Plasma 5.27 on a new HP Probook laptop, all goes well, but my backup script doesn't.
Below is the script followed by the error on trying to execute it
Code:#!/bin/bash
#To wake up the external drive
#partprobe /media/alexe/Elements
#get day of week
dow=$(/usr/bin/date "+%a")
# convert DOW to lower case i.e. Mon to mon
ldow=${dow,,}
/usr/bin/rsync -a /home/alexe/afolders/ /media/alexe/Elements/$ldow/
astatus=$?
/usr/bin/rsync -a /home/alexe/Desktop /media/alexe/Elements/$ldow/
dstatus=$?
[ $astatus -eq 0 ] && echo "$(date) My_Stuff rsync completed successfully" >> /home/alexe/Desktop/dailyBackup.txt || echo "$(date) My_Stuff rsync failed" >> /home/alexe/Desktop/dailyBackup.txt
[ $dstatus -eq 0 ] && echo "$(date) Desktop rsync completed successfully" >> /home/alexe/Desktop/dailyBackup.txt || echo "$(date) Desktop rsync failed" >> /home/alexe/Desktop/dailyBackup.txtCode:bash anajob.sh
rsync: [Receiver] mkdir "/media/Elements/sat" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(791) [Receiver=3.2.7]
rsync: [Receiver] mkdir "/media/Elements/sat" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(791) [Receiver=3.2.7]But, the folder "sat" does exist on the external drive named "Elements"
Tanks to whoever can help me
Alex
Attached Thumbnails
My desktop PC died and I installed KDE Plasma 5.27 on a new HP Probook laptop, all goes well, but my backup script doesn't.
Below is the script followed by the error on trying to execute it
Code:#!/bin/bash
#To wake up the external drive
#partprobe /media/alexe/Elements
#get day of week
dow=$(/usr/bin/date "+%a")
# convert DOW to lower case i.e. Mon to mon
ldow=${dow,,}
/usr/bin/rsync -a /home/alexe/afolders/ /media/alexe/Elements/$ldow/
astatus=$?
/usr/bin/rsync -a /home/alexe/Desktop /media/alexe/Elements/$ldow/
dstatus=$?
[ $astatus -eq 0 ] && echo "$(date) My_Stuff rsync completed successfully" >> /home/alexe/Desktop/dailyBackup.txt || echo "$(date) My_Stuff rsync failed" >> /home/alexe/Desktop/dailyBackup.txt
[ $dstatus -eq 0 ] && echo "$(date) Desktop rsync completed successfully" >> /home/alexe/Desktop/dailyBackup.txt || echo "$(date) Desktop rsync failed" >> /home/alexe/Desktop/dailyBackup.txtCode:bash anajob.sh
rsync: [Receiver] mkdir "/media/Elements/sat" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(791) [Receiver=3.2.7]
rsync: [Receiver] mkdir "/media/Elements/sat" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(791) [Receiver=3.2.7]But, the folder "sat" does exist on the external drive named "Elements"
Tanks to whoever can help me
Alex
Attached Thumbnails