Hi Byzantium,
Just so happens I’ve just (about a week ago) done what I think you are attempting. I looked at database backup snippets and the like but wanted something more custom. I needed a cron job to backup my database and any modx folders I specify, and email it it me twice monthly.
I also have little knowledge about shell scripting and cron but this is what I did and it works fantastically. Those more knowledgeable will probably tear it to shreds

; The following is the shell script which you upload to root and make executable:
#!/bin/sh
# USAGE:
# 1. Adjust variables below and upload file to /home/~username/
# 2. Check file permissions are 700
# 3. Setup cron job for 12:30am on 1st and 15th: 30 0 1,15 * * /bin/sh /home/USERNAME/backup-script.sh. Replace USERNAME with linux account name
# 4. Alter variables below to suit your setup
# website name
website='Website ABC'
# Filename prefix
filenames='ABC'
# linux account username
username='username'
#database info linuxusername followed by underslash followed by database username as in cpanel dbase settings
dbUser='account_username'
dbPassword='databasePassword'
#Folders to zip into archieve, seperate with spaces
# eg. foldersToZip='/home/$username/public_html/assets/css /home/$username/public_html/assets/img'
foldersToZip="/home/$username/public_html/assets/images"
#set min or max file size of files to tar and email. I set this to 150K so I don't set any monster image files which I don't really want.
# eg -100k = tar files less than 100Kb, +1000k = tar files larger than 1000k
maxFileSize=-150k
### --------------- DO NOT EDIT BELOW HERE ------------------ ###
# first make a mysqldump of all databases to gz
mysqldump -A --user=$dbUser --password=$dbPassword | gzip > /home/$username/mysqldump.gz
# find all files to tar and write to file
find $foldersToZip -size $maxFileSize -type f -print > /home/$username/filelist.txt
# tar all files in the generated filelist.txt file
tar -cz -T /home/$username/filelist.txt -f $filenames'_folders_'`eval date +%Y%m%d`.tgz
#setup vars for filenames and email
subject="Backup - $website"
# next binary-encode attachments and pipe to email
uuencode $filenames'_folders_'`eval date +%Y%m%d`.tgz `eval date +%Y%m%d`'_'$filenames'_files'.tgz | mailx -s "$subject" [email protected]
uuencode /home/$username/mysqldump.gz `eval date +%Y%m%d`'_'$filenames'_mysqldump'.gz | mailx -s "$subject" [email protected]
# finally, delete the backup files from the server
rm $filenames'_folders_'`eval date +%Y%m%d`.tgz
rm /home/$username/mysqldump.gz
rm /home/$username/filelist.txt
Next add a cron job via cpanel: 30 0 1,15 * * /bin/sh /home/USERNAME/backup-script.sh.
What this does is create a mysqldump of the specified database to root. Also a separate file is created of compressed folders, in this case /assets/images/ which is client image uploads. These files are emailed to me and then deleted from server. Takes about half a second to execute and backups appear in my inbox about 10 seconds later.
The code is a bit messy, have not had time to go over it but it works for me

Oh and replace the email address in the guts of the code with your own. Should’ve made that a var too I guess
Hope this helps.