1 2 3 4
find . -name ".svn" -type d -exec rm -rf {} \;
which only deletes directories named ".svn"
Absolute Automatification
1 2 3 4
find . -name ".svn" -type d -exec rm -rf {} \;
which only deletes directories named ".svn"
1
tar -cf backup.tar htdocs --exclude /var/www/somesite.com/htdocs/files
This will completely remove package along with any configuration files.
1
apt-get --purge remove package_name
Follow that up with
1
apt-get autoremove
Now you can search for any text on a Linux Server
1
find / -type f -print0 | xargs -0 grep -l "text to be searched"
Initial Steps
First SSH into your web server and move to the directory of the files you wish to tar up, since tarring an absolute path will save the folder structure as well which is bad (ie: /home/yoursite/public_html/backupthis/ will save the folders home -> yoursite -> public_html -> backupthis). You can get to the folder you need to by typing:
Creating a Tar
Now that we’re at the directory we want to tar, or the sub-directory, you can do one of two commands depending on what you need.
If you want to save every file / folder in your current location into a file called backup.tar.
If you want to save a tar named backup.tar with the folder “somefolder” and its contents.
You can test/view your tars with the following command:
Extracting the Tar
When you need to extract that tar, the following command will be suffice:
Recent Comments