smileyhead, 8 months ago Backups are created to /backup directory and are ended with .dump file extention. ls -1 is listing all those files chronologically, -1 is to keep one file per one line. head -n -2 is getting lines from the top to the last two at bottom. xargs rm -f is calling rm -f on every line of the input. | is pipe symbol, that gets output from command before and gives it to command after So TLDR it’s removing all backups except the last 2 ones.
Backups are created to /backup directory and are ended with .dump file extention.
ls -1 is listing all those files chronologically, -1 is to keep one file per one line.
ls -1
head -n -2 is getting lines from the top to the last two at bottom.
head -n -2
xargs rm -f is calling rm -f on every line of the input.
xargs rm -f
rm -f
| is pipe symbol, that gets output from command before and gives it to command after
|
So TLDR it’s removing all backups except the last 2 ones.