Mount AWS S3 on boot while behind proxy using s3fs

s3fs

In order to get a mount to work I have to first set the http_proxy environment variable before I run s3fs.

export https_proxy=<proxy address>
s3fs -d <bucket> mount-point -o url=https://s3.us-gov-west-1.amazonaws.com -o use_path_request_style

I'd like to mount my S3 bucket on boot but I am behind a proxy. I can add it to fstab, but it doesnt work because it doesnt know about the proxy.

Best Answer

You could probably do this using a systemd initialisation script.

You can control which order these run, by configuring the 'After' deceleration.

For example, using the following line should allow you to run a command after the network is up:

After=network-online.target

Related Topic