It would seem that you could use rsync to accomplish this task simply and use a script to call it with parameters. Your script is educational, though. Well done.
This works very well. I've been looking for something just like this but when you execute the file on the desktop, the terminal doesn't open the script still does its job. Is there a way to fix this
While on the desktop depending on the desktop enviornment you would have to make it exexutable or by going in to your terminal in the desktop and type: sudo chmod 755 backup.sh and thats it.
Hello, what happens to the files in destination that no longer exist in source? What if I delete 10000 files in source, shouldn't they also be deleted in destination?
But this only backs up files in source when there are only files in source right? What if there are subdirectories in the source folder too? It will duplicate because this only backs up files in the source folder.
This back-ups all files in the source including subdirs. Correct me if I'm wrong but it should as far as I know. I will do an updated version on this in the future, which will be more advanced. So if this does not support it, be patient. I'm going to focus on Bash the coming months. 😉
@@Herbertech yes youre correct it does backup files in the source including subdirs, but with the files in the subdirs in the source, it will backup more than once when you get into the destination folder. Basically in the destination folder there will be the subdir, and in the subdir there should only be files, but there is also another subdir of it inside
i followed your tutorial and it was really helpful, but i think this only works if you only have files inside a folder, not when there are also sub folders in it.
If a file is edited, it will backup that newer version. But if the file is in another directory and it's edited, it will backup that newer version but with the directory it's in as well.