0

I'm trying to setup a bash process for deploying my django project onto a linux server.

Through cygwin, I'm running a script that is calling scp to copy my files over. Is there a similar command to delete *.pyc files. As of now, I've only been able to accomplish this locally after using ssh with:

find . -name "*.pyc" -exec rm -rf {} \;

I'm looking for some kind of command to call remotely that would be equivalent.

2 Answers2

1

You can use ssh. The format of ssh is

ssh user@host command

so something like

ssh user@host 'find . -name "*.pyc" -exec rm -rf {} \;'

You should probably use absolute paths for the remote server so you know exactly where you are deleting files. Test it out with

ssh user@host 'find . -name "*.pyc" -print'

dmah
  • 516
  • 3
  • 5
1

you can sync your local to remote with rsync over ssh and have the Delete option

silviud
  • 2,687
  • 2
  • 18
  • 19