How to create an s3ql file system and mount it automatically at boot time?

I experimented with s3ql on Ubuntu 10.04, using it to mount Amazon S3 buckets. However, I would really like them to automatically mount them. Does anyone know how to do this?


Decision:

Thanks to the help of Nikratio s3ql Finally, I can mount the S3 buckets automatically when the system boots. You will definitely want to see the manual , but here are the basics of how to do it!

The first step is to create an authinfo file. This file must be placed in the .s3ql directory in the home directory of the user who will use it. The authinfo file contains login information that allows s3ql to mount buckets without prompting. Below is an example of what your authinfo file should look like. The first line contains your Amazon security credentials. The second contains the location and password for your bucket. You can add several lines to this file if necessary, but I use only one example in this example. At this point, the password for the bucket can be anything.

backend s3 machine any login ASDFGHJKL password ZXCVBNM
storage-url s3://mybucket password mypassword

. , Amazon Web Services , , . , , , s3ql s3ql. , .

, :

mkfs.s3ql s3://mybucket

. bucket authinfo.

, , :

mount.s3ql s3://mybucket /mnt/s3/bucket

, .

, , script /etc/init. , s3ql , s3ql.conf.

"-allow-other" mount.s3ql, , root, .

#
# This file can be placed in /etc/init. It defines an upstart job that
# takes care of mounting and unmounting an S3QL file system.
# 
description "S3QL Backup File System"
author      "Nikolaus Rath <Nikolaus@rath.org>"

start on (filesystem and net-device-up IFACE=eth0)
stop on runlevel [016]

env BUCKET="s3://mybucket"
env MOUNTPOINT="/mnt/s3/bucket"

expect stop

script
    # Redirect stdout and stderr into the system log
    DIR=$(mktemp -d)
    mkfifo "$DIR/LOG_FIFO"
    logger -t s3ql -p local0.info < "$DIR/LOG_FIFO" &
    exec > "$DIR/LOG_FIFO"
    exec 2>&1
    rm -rf "$DIR"

    # Check and mount file system
    fsck.s3ql --batch "$BUCKET"
    exec mount.s3ql --upstart --allow-other "$BUCKET" "$MOUNTPOINT"
end script

pre-stop script
    umount.s3ql "$MOUNTPOINT"
end script

script , , . .

, upstart script root, . .s3ql , /root, .

, - . S3, , .

, , . , , , , , . , , s3ql.

+3
1

Nikratio , , S3 . .

+1

Source: https://habr.com/ru/post/1784267/


All Articles