Hey thanks a lot for your answer.. does it also save subfolders then? And can I remove not needed variables from the php file, like this:
PHP Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
exit;
}
$backupdate = date("Y-m-d");
//"Y-m-d-H-i-s" to include time
$backupdir1 = "/my/path/to/useruploads/";
//Absolute path to where the files are located
//ie. "/home/sitename/public_html/forums/images/avatars/";
$files = "*";
//What file to backup? Use a * to backup all the files
//inside the folder entered above.
$backupto = "/my/path/to/backups/";
//Absolute path to where to store the backups
//Make sure to put this outside your root folder
//Permissions should be 777
//ie. "/home/sitename/backups/
$fileprefix1 = "alluseruploads";
//This is the prefix that will be added before the date:
//bak2006-02-25.tar
$tararg = "-cf";
//Here goes the tar arguments.
// -cf to archive - tar
// -cjf to archive and bzip2
// other notes:
// -tf to list the contents later on
// -xf to extract them all later on
//Call the function
backupsus($backupdate,$backupdir1,$backupto,$fileprefix1,$tararg,$files);
function backupsus($backupdate,$backupdir1,$backupto,$fileprefix1,$tararg,$files) {
$backupalluseruploads = "cd $backupdir1;
tar $tararg {$fileprefix1}{$backupdate}.tar $files;
mv {$fileprefix1}{$backupdate}.tar $backupto";
passthru ("$backupalluseruploads");
}
log_cron_action('Profile, Avatar and Attachment Backup Completed', $nextitem);
?>
Would I run into problems to just have 1 backup variable and 1 prefix variable?