Posted to tcl by Marko at Wed Jun 29 15:43:38 GMT 2022view raw

  1. #!/usr/bin/tclsh
  2. package require Tcl 8.6
  3. package require Tclx
  4. signal error sigint
  5. try {
  6. # set rc [system $run_cmd]
  7. # if {$rc == 0} {
  8. # puts "OK"
  9. # } else {
  10. # puts "Nope"
  11. # }
  12. if { [catch {set pid [exec -ignorestderr ssh dante rsync -av --progress /home/dante/test1 /home/dante/test2 >@ stdout &]} ]} {
  13. puts stderr "ERROR: Command failed"
  14. exit 3
  15. }
  16. wait
  17. } trap {POSIX SIG SIGINT} {} {
  18. # SIGHUP SIGKILL SIGTERM SIGQUIT SIGSTOP
  19. puts ""
  20. puts "Killing pid: $pid"
  21. kill $pid
  22. }

Comments

Posted by Marko at Wed Jun 29 16:25:31 GMT 2022 [text] [code]

Well, this was quite simple. This will handle Ctrl+C and stuff...: package require Tcl 8.6 package require Tclx system ssh -t dante2 rsync -av --progress /home/dante/test1 /home/dante/test2

  1. Well, this was quite simple. This will handle Ctrl+C and stuff...:
  2. package require Tcl 8.6
  3. package require Tclx
  4. system ssh -t dante2 rsync -av --progress /home/dante/test1 /home/dante/test2

AltStyle によって変換されたページ (->オリジナル) /