terminus icon indicating copy to clipboard operation
terminus copied to clipboard

Feature request: clear the remote files directory with rm -rf

Open HongPong opened this issue 3 years ago • 4 comments

Hi all,

in the process of moving around environment with tons of client files ( > 15GB ) the SFTP system can take a pretty long time to delete thousands of files .

I would request adding a terminus feature to rm -rf the files directory in the specified Drupal environment, (or wp-content/uploads for WordPress) which would be a lot faster than having SFTP walk across every directory.

HongPong avatar Oct 24 '21 04:10 HongPong

You could try and see if the Terminus Rsync Plugin can do this for you, e.g. if you rsync an empty directory to files with a delete option.

You could also try using terminus drush or terminus wp to run some php code with passthru.

Enhancing env:wipe to do only files or only the db would be another option, but that can't be done today, whereas the workarounds above should work.

greg-1-anderson avatar Oct 24 '21 16:10 greg-1-anderson

Thanks! I wasn't aware of passthru options. Appreciate the info today.

HongPong avatar Oct 24 '21 17:10 HongPong

For posterity:

This will DELETE ALL FILES in the environment you choose.

mkdir emptydir
terminus rsync emptydir SITE.ENV:files -- --delete --recursive --verbose

Using --verbose could be long but at least you know something is happening.

jonpugh avatar Jan 17 '24 16:01 jonpugh

P.S. Hi @HongPong!

jonpugh avatar Jan 17 '24 16:01 jonpugh