diff --git a/mirror/sync.sh b/mirror/sync.sh index 77d0f5b..9126662 100644 --- a/mirror/sync.sh +++ b/mirror/sync.sh @@ -1,18 +1,21 @@ #!/bin/bash ## mirror -sudo -u apt-mirror -g apt-mirror apt-mirror +lxc-attach -n c_apt-mirror -- sudo -u apt-mirror -g apt-mirror apt-mirror + +#ipfs check storage +lxc-attach -n c_ipfs -- /ipfs filestore verify #ipfs key gen --type=rsa --size=2048 archive.canonical.com # -> QmUajtQCL6yHcBaYxsZKyD8QH7n977ZVxjU5yMXwYC183c -hash_canonical="$(ipfs add --progress --local --nocopy --fscache --recursive /home/maddl/.ipfs/mirror/archive.canonical.com/ | tail -n1)" -name_canonical="$(ipfs name publish --key=archive.canonical.com `echo $hash_canonical | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)" +hash_canonical="$(lxc-attach -n c_ipfs -- /ipfs add --progress --local --nocopy --fscache --recursive /srv/apt-mirror/archive.canonical.com/ubuntu/ | tail -n1)" +name_canonical="$(lxc-attach -n c_ipfs -- /ipfs name publish --key=archive.canonical.com `echo $hash_canonical | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)" echo "archive.canonical.com/ubuntu -> $name_canonical" echo 'done' #ipfs key gen --type=rsa --size=2048 archive.ubuntu.com # -> QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ -hash_ubuntu="$(ipfs add --progress --local --nocopy --fscache --recursive /home/maddl/.ipfs/mirror/archive.ubuntu.com/ | tail -n1)" -name_ubuntu="$(ipfs name publish --key=archive.ubuntu.com `echo $hash_ubuntu | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)" +hash_ubuntu="$(lxc-attach -n c_ipfs -- /ipfs add --progress --local --nocopy --fscache --recursive /srv/apt-mirror/archive.ubuntu.com/ubuntu/ | tail -n1)" +name_ubuntu="$(lxc-attach -n c_ipfs -- /ipfs name publish --key=archive.ubuntu.com `echo $hash_ubuntu | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)" echo "archive.utuntu.com/ubuntu -> $name_ubuntu" echo 'done'