drone-scp icon indicating copy to clipboard operation
drone-scp copied to clipboard

`error: tar: unknown option -- -`

Open mrusme opened this issue 2 years ago • 1 comments

Closing https://github.com/appleboy/scp-action/issues/83 and reopening here, because I believe it's an issue with drone-scp expecting GNU tar on the other end, which isn't always the case (OpenBSD).

untar file xpkHVyWJzG.tar
error:  tar: unknown option -- -
usage: tar {crtux}[014578befHhjLmNOoPpqsvwXZz]
           [blocking-factor | archive | replstr] [-C directory] [-I file]
           [file ...]
       tar {-crtux} [-014578eHhjLmNOoPpqvwXZz] [-b blocking-factor]
           [-C directory] [-f archive] [-I file] [-s replstr] [file ...]

drone-scp error:  Process exited with status 1
drone-scp rollback: remove all target tmp file
remove file xpkHVyWJzG.tar

mrusme avatar Aug 01 '22 02:08 mrusme

To whomever comes across this issue: pkg_add gtar && ln -s /usr/local/bin/gtar /usr/bin/tar will do the trick on OpenBSD, as a workaround.

mrusme avatar Aug 01 '22 03:08 mrusme

@mrusme

```yaml
  uses: appleboy/scp-action@master
  with:
    host: example.com
    username: foo
    password: bar
    port: 22
    source: "tests/a.txt,tests/b.txt"
    target: "test"
+   tar_exec: gtar

appleboy avatar Apr 09 '23 03:04 appleboy