0

launching rsync in named screen so I can reattach to check progress, how can I run a command after the rsync, as is it launches the screen then immediately executes the command?

screen -dmS  name rsync
ssh   user@hostname 'rm -r ~/path/*'

I'm trying to delete the symlinks of file copied by the rsync,, kind of a "copy once" I don't want to delete source files though.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
G.Martin
  • 135
  • 7

1 Answers1

1

I suggest running the command inside screen. You could do this by creating a shell script, but in this case the sh -c trick should be sufficient.

screen -dmS  name sh -c "rsync args_go_here; ssh user@hostname 'rm -r ~/path/*'"
ams
  • 24,923
  • 4
  • 54
  • 75