Step 1: Insert a CD or DVD
Assuming that you’re using an external CD/DVD drive, the first step is to connect your drive to your computer, and then insert a CD or DVD. If you insert a movie or music CD and an application automatically starts playing, quit that application.
As I mentioned in my How to find multiple filenames with Linux find tutorial, you can use
find command syntax like this to find files with multiple filename extensions:
find iTunes \( -name "*.mp3" -o -name "*.m4a" \)
As that command shows, I ran this
find command to find all of my music files under my iTunes directory, including .mp3 and .m4a filename extensions.
While I’m in the neighborhood, this is the full
find command I use to backup all of my iTunes files that have changed or been added in the last 180 days:
find iTunes \( -name "*.mp3" -o -name "*.m4a" \) -type f -mtime -180 -print0 | xargs -0 tar rvf NewMusic.tar
There’s probably an easier way to do this, but that backup command works for me.
As a short note today, if you want to make an offline copy/mirror of a website using the GNU/Linux
wget command, a command like this will do the trick for you:
I’m spending a little time today trying to automate the process of backing up my websites, and in doing so I thought I would share the Linux shell scripts that I use to generate the backup files, including backups of my MySQL databases and Drupal website directories. If you are comfortable with shell programming in Linux, I think you’ll be able to follow the code in the following scripts.
MySQL database backup script
First, this is a backup script I use to backup a MySQL database:
MySQL database FAQ: How do I backup (back up) a MySQL database?
MySQL database FAQ: How do I restore a MySQL backup? (Also written as, "How do I restore a
Assuming that you’ve created a MySQL backup file as shown in my “MySQL backup - How to Backup a MySQL database” tutorial, you can use the commands shown here to restore your MySQL database.
This morning I decided to take a few minutes to backup all the songs I've purchased over the last half-year. These are all on my Mac OS X system, under the Music folder in my home directory.
The problem with trying to do this with standard Unix tools is that all these subdirectories and filenames have spaces in their names. Just looking at the Music folder, it contains many directory names like this:
MySQL database backup FAQ: Can you share a Linux shell script that I can use to make a MySQL backup (i.e., a shell script that wraps the mysqldump command)?
I currently have a collection of websites on several different servers (including GoDaddy and A2 Hosting web servers), so I was just spending some time trying to automate my MySQL database backups. To that end, I just created a MySQL shell script that I use on each Linux server to make my database backups, and I thought I'd share that script here.
sed command FAQ: How can I use the Unix/Linux sed command to edit (modify) files in place?
The short answer is that you just need to use the -i or --in-place sed arguments, as shown in the sed man page:
-i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if extension supplied)
Then, if you have a file named 'hello.txt' with contents like this:
jello, world this is a test
you can then run a sed command like this to modify that file: