I have continued to fiddle with this and work out some problems I was having. First of all, here is my top part where I set my variables:
$filename= "Shultz_Backup-$datestamp.tar"; // The name (and optionally path) of the dump file
$ftp_server = "

"; // Name or IP. Shouldn't have any trailing slashes and shouldn't be prefixed with ftp://
$ftp_port = "21"; // FTP port - blank defaults to port 21
$ftp_username = "

"; // FTP account username
$ftp_password = "

"; // FTP account password - blank for anonymous
$filename = "/home/<myaccount>/" . $filename . ".gz";
$command = "tar cvf $filename ~/*";
$result = exec($command);
$command = "gzip -9 -S .gz $filename";
$result = exec($command);
For the tar and gzip commands, I had to remove the ~/ in front because if not, it did not build my path correctly and then it would not create the file. So once I figured this out, I can see it creating my backup file on my server and it also unlinks at the end properly.
However, I am having problems FTPing. In the email I get, it says FTP connection to the server was successful.
If I run the ftp_put() command like the following:
$upload = ftp_put($ftp_conn, $filename, "/SalesBackup/backup.tar.gz", FTP_BINARY);
It just says "Upload Failed", no errors or warnings
If I run ftp_put command like the following:
$upload = ftp_put($ftp_conn, "/SalesBackup/backup.tar.gz", $filename, FTP_BINARY);
It makes a comment about the STOR command not working for /home/<myaccount>/Shultz_Backup-<date>.tar.gz... --> It seems that it is trying to FTP to the directory as designated on the lunarpages server, not as my FTP server.
The other thing as you can see above is that on my FTP server, when you FTP in, you then need to drill into a directory and then place the file. The directory name is SalesBackups. Do I need to do /SalesBackups/... or SalesBackups/...?