ArchiveTeam / IA.BAK

We back up a lot of stuff from around the web; now it's time to back up the Internet Archive, just in case.
GNU General Public License v3.0
87 stars 22 forks source link

Consider using env to find bash / perl for freebsd #48

Open stephen304 opened 7 years ago

stephen304 commented 7 years ago

I would love to run this on my freenas box, but the scripts fail to run because perl and bash aren't in /bin.

Using #!/usr/bin/env bash seems to be the correct platform-agnostic way to invoke bash (or perl)

This fix is needed in ./iabak and flock.pl

ghost commented 7 years ago

A temporary workaround I have used is to create symbolic links in /bin/, but it's not an ideal solution.

stephen304 commented 7 years ago

I think that's less ideal than editing both scripts since that would be modifying the system in an untrackable way (package manager might freak out).

#!/usr/bin/env bash and #!/usr/bin/env python both work on FreeBSD and regular flavors of Linux, so I think it's the proper solution.

https://stackoverflow.com/questions/17614643/how-do-i-get-a-bash-script-working-on-freebsd-openbsd-and-linux-without-modifyi

db48x commented 7 years ago

What about systems that don't have env?

stephen304 commented 7 years ago

Sure, the env method doesn't work on all systems, but neither does using /bin/bash. It would at least be an improvement.

Alternatively, using /bin/sh instead of bash is a reliable way to make it work on a wide variety systems, but that doesn't solve invoking python, which is also broken on FreeBSD because of the hard coded path. (You guys seem to have used sh in the first script but not the second, which I don't quite understand.)

jadzdotcom commented 7 years ago

I ended up running an iohyve/bhyve Ubutnu VM to run this script on my FreeNAS server. I suspect the FreeNAS world could be a good contributor to this project. A plugin or streamlined setup method in the future would increase adoption (as I understand it they are moving away from their classic plugins in favor of VMs).