A question of rsync vs. something else reddit / BSD ---------------------------------------------------------------------- osglith · 2020-12-01 16:01 Hello, I'm not very knowledgable about shells/scripts. I need to run a shell script via an application and I'm hoping someone with more knowledge can help. After my software backs up/archives files in a folder, I need to run a script that will move all the files outside the directory. So I'm thinking this is rsync to copy, verify, then delete. Does this make the most sense, or should I be looking for another command? Thank you for any time you can offer to help. ---------------------------------------------------------------------- aschenpinecat · 2020-12-01 16:34 Rsync should be fine for copying and verifying the data. Normally, it will perform a "quick check", to ensure that the data copied is good, but you can specify a parameter to have it use a checksum to verify the data integrity instead ([https://www.freebsd.org/cgi/man.cgi?query =rsync](https://www.freebsd.org/cgi/man.cgi?query=rsync) (see the OPTIONS section of the man page)). You can also tell rsync to synchronize file deletions (i.e. if you delete a file on one machine and sync, it will delete that file off the other). If you need to move files after they are backed up however (and you know about what time you'll be backing up each day), you could always run a crontab ([ https://www.freebsd.org/cgi/man.cgi?crontab](https://www.freebsd.org/c gi/man.cgi?crontab)). Not sure what flavor of BSD you're using, but cron should be available on just about any one. Of course, if you're syncing continuously, a crontab may not be what you want. If that's the case, you could use inotifywait to listen on the directory for changes, and then do something with the file/s ([https://www.freebsd.o rg/cgi/man.cgi?query=inotifywait](https://www.freebsd.org/cgi/man.cgi? query=inotifywait)). Hope this helps! ---------------------------------------------------------------------- osglith · 2020-12-01 18:22 Thank you for your response and links. I've got some reading to do... ---------------------------------------------------------------------- techsnapp · 2020-12-01 21:25 Here's a BSD licensed implementation of rsync: [https://github.com/kri stapsdz/openrsync](https://github.com/kristapsdz/openrsync) ---------------------------------------------------------------------- nahnah2017 · 2020-12-01 21:39 Note that on Unix/BSD and Linux, too, they are "directories" and not the user/Windows concept of "folders" which is not the same thing. ---------------------------------------------------------------------- efxhoy · 2020-12-01 22:19 mv is the simplest file moving command. ---------------------------------------------------------------------- crocflamingo · 2020-12-02 03:30 From what you're saying, prolly mv. Mv for moving local files, rsync for moving files over a network.