enter code here
I do not understand why I am getting the "No such file..." error.
fstab is in home/andy/Downloads/
Here is what is relevant in my backup script.
# Backup fstab
cat /etc/fstab > home/andy/Downloads/fstab
tar -cvf fstab.tar home/andy/Downloads/fstab
rsync --progress -r -u fstab.tar $Backup_Directory
rsync --progress -r -u fstab.tar $Local_Backup_Dir
And the output.
Thunar_Settings.tar
10,240 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/1) sending incremental file list
-rw-rw-r-- 10,240 2022/12/01 22:27:27 Thunar_Settings.tar
/home/andy/bin/Backup_20_04.sh: line 79: home/andy/Downloads/fstab: No such file or directory
tar: home/andy/Downloads/fstab: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
I added the / to the appropriate places.
tar: Removing leading `/' from member names /home/andy/Downloads/fstab sending incremental file list fstab.tar
It creates the tar file and sends it to the 2 locations.
Your script uses the absolute path
home/andy...
but this is not a valid path.Absolute paths must start with a
/
So if your username is
andy
then the absolute path to your user's home folder would be/home/andy/...