Closed tudor2004 closed 9 years ago
@tudor2004 Thanks for pointing this out.
I've been running some tests with other commands and I believe the following will work best as a replacement:
find . -maxdepth 1 -name "20*" -mmin +2880 | head -n 5 | xargs rm -Rf;
This should delete any deployments older than 48 hours, limiting to the first 5 it finds to keep some backups for rolling back to.
In hindsight, ls -1d 20* | head -n 5 | xargs -d sudo rm -Rf;
would delete the first 5 deployments (including the one you just did) if used.
Updated in dab29a4dd27f77be279302b04f4fe7d53b8036e2
The
ls -1d 20* | head -n -5 | xargs -d \'\n\' sudo rm -Rf;
doesn't work. It seems there is an issue with the '\n'. If i output the command I get the following:ls -1d 20* | head --lines=-1 | xargs -d n sudo rm -Rf