Today colleagues found that the internal server's hard disk space is not enough, there are many backups, I can not delete, and found a 320g hard disk mounted, want to later the shell script backup to the new hard disk, to make room for the old hard drive, the original backup path is/data/onlinesqlbak/ , the new backup path is/disk2/onlinesqlbak/, I find the next backup shell script, this look scared to death of a person, at least 10-20 backup shell to change, who called me a lazy person think about finishing, well come to see my solution.
System: CentOS 5.x
1. Confirm that there are those scripts to change
Copy Code code as follows:
Find ~/soft_shell/-name "*" |xargs grep "/data/onlinesqlbak/"
2. Replace the content in the script
Copy Code code as follows:
Find ~/soft_shell/-type f-path "*.sh" |xargs sed-i ' s:/data/onlinesqlbak/:/disk2/onlinesqlbak/:g '
3. Verify
Copy Code code as follows:
Find ~/soft_shell/-name "*" |xargs grep "/disk2/onlinesqlbak/"
All right, it's going to be a pretty big deal soon.