Last active
August 29, 2015 14:20
-
-
Save demofly/134d8d2281ed39c134f1 to your computer and use it in GitHub Desktop.
Найти все лишние деплои, кроме текущего и последних трех
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ls -l | |
total 20K | |
lrwxrwxrwx 1 nginx nginx 26 Apr 24 18:09 current -> deploy-2015-04-24_14-50-32 | |
drwxrwxr-x 7 nginx nginx 4.0K Apr 24 17:52 deploy-2015-04-24_14-50-32 | |
drwxrwxr-x 3 nginx nginx 4.0K Apr 24 18:06 deploy-2015-04-24_18-06-22 | |
drwxrwxr-x 3 nginx nginx 4.0K Apr 24 18:10 deploy-2015-04-24_18-10-44 | |
drwxrwxr-x 4 nginx nginx 4.0K Apr 26 22:46 deploy-2015-04-26_22-43-37 | |
drwxrwxr-x 4 nginx nginx 4.0K Apr 27 16:00 deploy-2015-04-27_15-58-33 | |
# ls -dt `find -maxdepth 1 -type d ! -name "\`ls -l current | sed 's#.* -> ##'\`" -name 'deploy-*'` | tail -n +4 | |
./deploy-2015-04-24_18-10-44 | |
./deploy-2015-04-24_18-06-22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment