Hi everyone,
I am trying to create a simple batch file to make SQL backups. this part of it works fine. Currently the script can mysql dump the databases, compress them, delete the .sql, compress the individual tar.gz into one larger one, delete the smaller files, encrypt the final tar.gz and then rsync it to 2 servers.
now I am adding some error control what I would like is this, when each mysqldump runs it echoes to a backup file saying done,
I can do this on an individual basis (echo "backup of $DBNAME done" >>log-$TIMESTAMP.log)
but what I would rather be able to do is call the echo instead
so have something like: $DUMPLOG='echo "backup of $DBNAME done" >>logfile.log and then call it using $DUMPLOG.
but that just echoes the results to the terminal. how can I do this?
Any ideas?
Thank you
(I am pretty new to Scripting and programming, bare with me please
)
Luma