Archive for the ‘Utilities’ Category

Simple backup from the command line

January 24, 2010 Leave a comment

I must say I don’t have much faith in Ubuntu’s sbackup program. Sure, it’s convenient and it’s got a GUI and automatically creates compressed incrementals backup in the background for you. But who knows if I’ll ever be able to actually restore my data from these compressed files? I prefer something where I can actually see what has been backed up, even if it’s a little less convenient.

For my backups, I use this command (that can be used in a cron job) that simply incrementally copies files onto a second hard drive:

cp -dpRuvx /home/yourfolder /media/data/backup 2> ~/Desktop/backup_errors.log

As a safeguard, all error output is redirected into a log file on my desktop. The drawback of this method is that files that you deleted on your source drive remain in the backup. That means that you have to do a clean backup every once in a while otherwise you’ll run out of space on your backup drive.

Categories: Utilities

Merging PDF files from the command line

January 24, 2010 Leave a comment

To merge the pdf files infile1.pdf, infile2.pdf, and infile3.pdf, and output the result into a new file outfile.pdf in the same directory, do:

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=outfile.pdf infile1.pdf infile2.pdf infile3.pdf

Note: Requires the ghostscript package.

Categories: Graphics, Utilities