Skip to content

Instantly share code, notes, and snippets.

@codersquid
Last active October 17, 2016 19:40
Show Gist options
  • Save codersquid/10c978e0f792f0e59290f0a93a11c3df to your computer and use it in GitHub Desktop.
Save codersquid/10c978e0f792f0e59290f0a93a11c3df to your computer and use it in GitHub Desktop.
quick script to troubleshoot what is going on with recursive push
#!/bin/sh
set -ex
LXC=/home/sheila/gopath/bin/lxc
COUNT=${1:-5}
echo making $COUNT test files
rm -rf exampledir
mkdir exampledir
for i in $(seq $COUNT)
do
echo testing > exampledir/testfile$i
done
echo Launching container
NAME=$($LXC launch ubuntu:16.04 | grep Starting | awk '{print $2}')
if [ -z "$NAME" ]; then
echo Unable to create container. exiting...
exit 1
fi
echo Created $NAME
echo pushing files
$LXC file push -r $(pwd) $NAME/tmp
echo listing remote files in /tmp
$LXC exec $NAME -- find /tmp
echo local files
tree $(pwd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment