this should work, :) thanks again... now i can use s3ql with amazon cloud
unlimited space and veryvery fast.
> #!/bin/bash
>
> /root/s3ql/s3ql-2.20/bin/s3qlctrl flushcache /mnt/s3ql/Vid_amazon/
> /root/s3ql/s3ql-2.20/bin/s3qlctrl upload-meta /mnt/s3ql/Vid_amazon/
>
> acdcli sync
> sleep 1
>
> DB_FILE="/root/.s3ql/local:=2F=2F=2Fmnt=2Funionfs_amazon_vid=2F.db"
> DIR_WITH_DATAFILES="/mnt/amazon/s3ql_vid/s3ql_data_/"
>
> set -e # stop execution on error
>
> WORKDIR=$(mktemp -dt "$(basename "$0").XXXXXXXXXX")
>
> # first map what is there then find out what should be there
> # other way round is dangerous if the file system is mounted
> # (upload new file between steps -> file gets deleted)
>
> # what is there
> cd "$DIR_WITH_DATAFILES"
> find . -name 's3ql_data_*' > "$WORKDIR/actually_there"
>
> # what should be there
> sqlite3 "$DB_FILE" "SELECT './s3ql_data_' || id FROM objects ORDER BY id" \
> > "$WORKDIR/should_be_there"
>
> # comm wants lexical sorted files, sqlite prvides naturally soted
> sort "$WORKDIR/should_be_there" > "$WORKDIR/should_be_there_sorted"
> rm "$WORKDIR/should_be_there"
> sort "$WORKDIR/actually_there" > "$WORKDIR/actually_there_sorted"
> rm "$WORKDIR/actually_there"
>
> cd "$DIR_WITH_DATAFILES"
>
> # compare the two lists and delete all files that are only in the second
> one
> # to run command remove echo...
> comm -13 "$WORKDIR/should_be_there_sorted"
> "$WORKDIR/actually_there_sorted" \
> | sed -e 's/\.//g' | xargs -i echo "acd_cli rm /s3ql_vid/s3ql_data_"{}
>
> sleep 10 #wait cloud to update it take few sec before changes is visible
>
> acdcli sync
>
> rm -f \
> "$WORKDIR/should_be_there_sorted" \
> "$WORKDIR/actually_there_sorted"
> rmdir "$WORKDIR"
>
>
>
--
You received this message because you are subscribed to the Google Groups
"s3ql" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.