I want to copy all files including "hidden" . files from a directory output to a remote directory target using scp. Alternatives welcome except rsync. Unfortunately the hosting provider won't allow its installation.
I have looked up several solutions and it seems harder than what I expected.
scp -P 22 -r path/to/output/ "$USER@$HOST:/path/target/"
and
scp -P 22 -r path/to/output "$USER@$HOST:/path/target/"
put files to /path/target/output/ or requires renaming.
scp -P 22 -r path/to/output/* "$USER@$HOST:/path/target/"
This does not match hidden files.
scp -P 22 -r path/to/output/. "$USER@$HOST:/path/target/"
This no longer works (details in comment to https://unix.stackexchange.com/a/232947 ).
scp -P 22 -r path/to/output/{,.[!.],..?}* "$USER@$HOST:/path/target/"
This will fail in case not all patterns have a match (e.g. missing files of the form .<filename>.
I am looking for a way to just copy all contents of a directory recursively to a remote directory. I have SSH or FTP access. Bonus would be to clean the target dir before copying.
Edit: leaving the trailing slash for target has no impact