diff options
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/100-willikins.yarn | 1 | ||||
-rw-r--r-- | yarns/900-implements.yarn | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/yarns/100-willikins.yarn b/yarns/100-willikins.yarn index 697897b..3360925 100644 --- a/yarns/100-willikins.yarn +++ b/yarns/100-willikins.yarn @@ -10,3 +10,4 @@ backups. It is only ever accessed over ssh (including sftp). AND server hostname is as expected AND server account has sudo AND server has python version 2 installed + AND server allows SFTP diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn index f08baee..57f52aa 100644 --- a/yarns/900-implements.yarn +++ b/yarns/900-implements.yarn @@ -61,6 +61,21 @@ exit code for later inspection. echo $? > "$DATADIR/exit" fi +## Access server over SFTP + +Put and get a file over SFTP. + + IMPLEMENTS THEN server allows SFTP + . "$DATADIR/config.sh" + echo test.file > "$DATADIR/sftp.file" + cat > "$DATADIR/sftp.commands" << EOF + put $DATADIR/sftp.file sftp.file + get sftp.file $DATADIR/sftp.file.copy + rm sftp.file + EOF + sftp -b "$DATADIR/sftp.commands" "$ACCOUNT@$SERVER" + cmp "$DATADIR/sftp.file" "$DATADIR/sftp.file.copy" + ## Inspect results of running a command The stdout, stderr, and exit code have been saved. Inspect them. |