#! /bin/bash DIRECTORY=/home/dbbackup if [ ! -d "$DIRECTORY" ]; then mkdir -p $DIRECTORY fi dpkg --get-selections > $DIRECTORY/package.selections