Re: How to do an rm through ssh
- From: Unruh <unruh-spam@xxxxxxxxxxxxxx>
- Date: 14 Jul 2006 07:00:17 GMT
"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
.
- Follow-Ups:
- Re: How to do an rm through ssh
- From: Wences
- Re: How to do an rm through ssh
- References:
- How to do an rm through ssh
- From: Wences
- How to do an rm through ssh
- Prev by Date: Re: How to do an rm through ssh
- Next by Date: Re: How to do an rm through ssh
- Previous by thread: Re: How to do an rm through ssh
- Next by thread: Re: How to do an rm through ssh
- Index(es):
Relevant Pages
|
|