Greetings all; very helpful thread. Thanks to everyone.
[Edited for clarity]
I'm working on doing backups done of my site. I don't want to back up the whole site; nor do I want to back up my entire database. It will be a five-step process for my daily backups:
1) Dump several tables from my database into a .SQL file in my backups directory (Done, using a PHP file)
2) Copy several custom PHP files from my site to that same backup directory (Done, using a PHP file)
3) Combine all of the files created in #1 and #2 into a TAR file (PROBLEM)
4) Gzip that TAR file (Unstarted)
5) FTP it off-site (Unstarted)
I'm having a problem with step 3, TAR'ing all of the files in my backup directory. The PHP file that I created to TAR the 8 or 9 files in this directory is named backup.php, and it consists of:
><?php
// date & timestamp file
// commented out until I figure out what's wrong with my tar syntax
// $filename="/".date("Y-m-d_Hi", mktime())."_backup";
// create .TAR file
exec("tar -cvf mybackup.tar /public_html/backups"); // tarring everything in the directory
?>
When I point my browser to www/backups/backup.php, it executes, but the "testbackup.tar" file that is created is a 10240-byte file filled with NULL, and which (according to 7-Zip file manager) is not a valid archive.
Plus, I'm backing up about 120k worth of files (PHP and SQL dump files), so I know that a 10k file isn't right.
Can anyone shed some insight into what I may be doing wrong?
Thanks in advance for any help. I hope this makes sense.
Syenna