I use rsync
to backup my data to an external drive by running a bash script. In it, the instructions are as follows:
#!/usr/bin/env bash
#Backup
#-r : recursive
#--size-only : ignore timestamp, use size
#-t : transfer modif times
#-v : verbose
#--progress : show transfers as they happen
#--delete-before : files to be deleted are done so before transfers
#-u : update; skip newer files on target
#-L : follow symlinks
#
rsync -r --size-only --progress --delete-before -t -v -u -L /home/user/Desktop/backup/ /media/guajardo/BCKPDRV/jomdir/
On my Desktop directory backup
I have symlinks to all the directories I want to sync. I recently moved everything in the external drive to the directory jomdir
(it all used to be in the root dir. for this drive), and now when I run the script I get the error
line 12: /media/user/BCKPDRV/jomdir: Is a directory
.
This didn't happen when everything was on the root dir. of the drive. However, when I run the above command on bash but replacing the full path by a relative path ( Desktop/...
etc), it works; moreover, when I modify the script and use ~/Desktop/...
etc, the error disappears and rsync
works.
Any ideas on why this happens? Please: I do want to keep using rsync
because I have several other scripts I use regularly for this sort of thing.
Thanks a lot!
EDIT: As I mentioned before, the rest of the script is just comments so I don't forget what each options does; nonetheless, here it is.
/home/user/Desktop/backup
a symbolic link too?/
missing in the line 12?backup
dir. contains symlinks but it is not itself one; @BANJOSA: the script is the instruction I posted, essentially; the rest of the lines are comments so I don't forget what each option does. Where do you say a backslash is missing?/media/user/BCKPDRV/jomdir/
and not/media/user/BCKPDRV/jomdir