News:

SMF - Just Installed!

Main Menu

bash script / tar warning

Started by mahesh, Sep 14, 2023, 03:40 AM

Previous topic - Next topic

mahesh

 I cobbled together the script from some google searches:

    Code:
#!/bin/sh

# place in /etc/cron.daily & make executable
# terminal test command: run-parts /etc/cron.daily

# This Command will read the time, day and date.
# Careful - FAT32 does not like colons in filenames
TIME=`date +%H%M-%a-%b-%d-%Y`

#------------------------------------------------
# 1. backup firefox profile               
FILENAME=firefoxprofile$TIME.tar.gz
# Source backup folder.
SRCDIR=/home/me/.mozilla/firefox/profile.default
# Destination of backup file.
DESDIR=/media/me/USBBACKUP/000-AUTOBACKUPS
tar -cpzf $DESDIR/$FILENAME $SRCDIR
#------------------------------------------------
# 2. backup thunderbird profile               
FILENAME=thunderbirdprofile$TIME.tar.gz
# Source backup folder.
SRCDIR=/home/me/.thunderbird/profile.default-release
# Destination of backup file.
DESDIR=/media/me/USBBACKUP/000-AUTOBACKUPS
tar -cpzf $DESDIR/$FILENAME $SRCDIR
#------------------------------------------------

exit 0

It goes in /etc/cron.daily and backs up my thunderbird and firefox profiles to a USB drive once a day, it seems to work fine.

When I do

    Code:
run-parts /etc/cron.daily
in terminal to test it, terminal reports

     Code:
me@skully:~$ run-parts /etc/cron.daily
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names

Should I be concerned, have I got my syntax wrong somewhere?
I like the dollar uptime thing