Re: How to do an rm through ssh



"Wences" <wgrillo@xxxxxxxxx> writes:

Hello, everybody.

I'm trying to set up a little bash script that will be fired regularly
by the crond.
It should connect over the Internet through SSH to another computer
running Windows + cygwin + sshd, erase old backups and create new ones.

The problem is that this line fails:

ssh -i /root/.ssh/some_user-identity -p XXX some_user@xxxxxxxxxxxxxxx
-s \
"rm -fr /cygdrive/d/backup/$day_of_week/*"

Why the -s?
Why all of the arguments?

IF you are going to a unix computer,
ssh user:machine.name name of the command
will run the command name with arguements "of the command" on computer
machine.name as user user.
However I have no idea what would happen on a Windows machine. rm is not a
windows command, - is not the windows argument designator.



( $day_of_week is 1_Monday, 2_Tuesday, etc, and those directories exist
)
The error message says:

Request for subsystem 'rm -fr /cygdrive/d/backup/4_Thursday/*' failed
on channel 0

Yes, rm -fr ... is NOT a subsystem ( whatever that is.)


What's the meaning of that?
This other line works OK. I guess that discards a lot of possibilities:

scp -i /root/.ssh/some_user-identity -P XXX todays_backup.tar.gz \

some_user@xxxxxxxxxxxxxxx:/cygdrive/d/backup/$day_of_week

What does -P XXX mean? that is not an option under openssh.


What's wrong?

Too rococo a command line?


Thank's for your help:

Wences

.



Relevant Pages

  • RE: re-setting boot partition
    ... Description of the Windows 2000 Recovery Console ... For a Microsoft Windows XP version of this article, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ...
    (microsoft.public.win2000.setup_upgrade)
  • RE: Win2000 Upgrade to SP3 Express Setup error.
    ... Start your computer with the Windows Setup floppy disks, ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ... you cannot copy a file from the local hard disk to a floppy disk. ...
    (microsoft.public.win2000.setup_upgrade)
  • RE: Locating corrupt driver
    ... This article describes the functionality and limitations of the Windows ... Create and format partitions on drives. ... MB of hard disk space on your system partition to hold the Cmdcons folder ... Windows NTBoot Console Command Interpreter. ...
    (microsoft.public.win2000.applications)
  • Software Report [Windows Tips: Command Line Control - 08/03/2005]
    ... Windows Tips: Command Line Control ... Some of Windows' most useful tools don't have desktop icons. ... Stay awake at the switch: While the commands are useful by themselves, ... When your command acts on a file or folder (such ...
    (comp.sys.ibm.pc.misc)
  • Re: DOS Box Keyboard problem
    ... mode con codepage select=860 ... This is copied from a command prompt, I did not type a single character, all ... into) Command Prompt windows with a mouse. ... I get 437 from command chcp and cmd chcp. ...
    (microsoft.public.windowsxp.configuration_manage)