backup

Backing up delicious bookmarks

Social bookmarking services like Delicious are great for sharing your bookmarks with others or just across multiple computers. But one disadvantage of having them stored in a central location is that you have no control over the backup strategy they use. What if they suffer from a system crash and lose all your data?
If you think I'm just being paranoid, think of what happened to Ma.gnolia recently.

Just to be safe, I wrote a simple little script that takes a copy of all my bookmarks - in XML format - and stores it locally on my PC. Because it is in XML format, converting this data to some other format in the future should be fairly trivial.

  1. #!/bin/sh
  2.  
  3. # Your delicious username and password, separated by a colon
  4. CREDENTIALS="UserName:YourPassword"
  5. # Location where the backup will be stored
  6. BACKUP_DIR="$HOME/backups/del.icio.us"
  7.  
  8.  
  9. if [ ! -d "$BACKUP_DIR" ] ; then
  10. mkdir -p "$BACKUP_DIR"
  11. fi
  12.  
  13. DATE=$(date +"%Y%m%d")
  14. curl --user "$CREDENTIALS" -o "$BACKUP_DIR/bookmarks-$DATE.xml" -O "<a href="https://api.del.icio.us/v1/posts/all"

">https://api.del.icio.us/v1/posts/all"
[/geshifilter-code]

The script is run from cron on a regular basis, so even if something were to happen to Delicious, I still have a copy of all my bookmarks. Lets hope I never need it.

Blog Category:

Subscribe to RSS - backup