1
vote
5answers
450 views

selective backup script in bash

I've been using this simple command (that's all I can do :) to backup the whole tree from my user data in NAS server for a year. cp -r /STORAGE /BACKUP-STORAGE/YYYY-MM-DD Unfortunately, after a ...
0
votes
2answers
171 views

Remove parts of a path using parameter expansion… but how?

I need to remove the part man1/bmtoa.1.gz from the full path /usr/share/man/man1/bmtoa.1.gz so that it results in /usr/share/man/ I've tried ${path#[!/]*/*} and ${path#/*/*} but ...