Skip to content

Commit eebf55e

Browse files
committed
exclude backuplocation when creating the file archive
1 parent 68da1c1 commit eebf55e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fullsysbackup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ sleep 1
6161
printf "%b" "\e[1mBacking up system and user files...\e[0m\n"
6262

6363
# TODO: dialog output
64-
#if (tar -cf - "${backuppaths[@]}" | pv -s $(du -cb "${backuppaths[@]}" | tail -1 | awk '{print $1}') | gzip --force > archive.tar.gz) 2>&1 | dialog --gauge "Backing up your files..." 7 70; then
64+
#if (tar -cf - "${backuppaths[@]}" --exclude="$backuplocation" | pv -s $(du -cb "${backuppaths[@]}" | tail -1 | awk '{print $1}') | gzip --force > archive.tar.gz) 2>&1 | dialog --gauge "Backing up your files..." 7 70; then
6565
#
6666

67-
if tar -cf - "${backuppaths[@]}" | pv -s $(du -cb "${backuppaths[@]}" | tail -1 | awk '{print $1}') | gzip --force > $backuplocation/backup-files-$today.tar.gz ; then
67+
if tar -cf - "${backuppaths[@]}" --exclude="$backuplocation" | pv -s $(du -cb "${backuppaths[@]}" | tail -1 | awk '{print $1}') | gzip --force > $backuplocation/backup-files-$today.tar.gz ; then
6868
printf "%b" "\e[31mSystem and user files backup: \e[32mdone.\e[0m\n"
6969
else
7070
printf "%b" "\e[31mError: Could not backup files.\e[0m\n" && exit 0

0 commit comments

Comments
 (0)