2

Bash script problems

view story
linux-howto

http://www.linuxquestions.org – Hello I'm doing a script for doing backups but i can only backup directories from / any other files for example /etc/X11 cannot be backed up. how do i solve this? this is the code i'm using now: #!/bin/bash clear read -p "Enter the directory to backup:" DIRECTORY echo echo "backing up $DIRECTORY" BACKUP_FILE=/backups$DIRECTORY-$(date +%Y%b%d.%Hhr%Mmin%Ssec).tgz tar -czf $BACKUP_FILE $DIRECTORY >> /dev/null2>&1 echo echo "$DIRECTORY is backup as file $BA (HowTos)