In my provider, those functions are disabled:
exec,passthru,shell_exec,system
thus in my backupping script, I cant execute mysqldump
and tar
command. Then what can I do?
In my provider, those functions are disabled:
exec,passthru,shell_exec,system
thus in my backupping script, I cant execute mysqldump
and tar
command. Then what can I do?
2
Answers
For the database part : As an alternative, you may use
SELECT * INTO OUTFILE
For details, refer to Mariadb offical documentation and Mysql official documentation
So a typical syntax can be (if you want to specify the format)
So the sample code (say using mysqli) is (amend to suit your needs):
Note: if you want to "restore" your data, use
LOAD DATA INFILE ...
. See official documentationcronjob
This assumes the backup is run by the root user, but the process is very similar if it is at the account level.
/etc/cron.d/backup
If you have root access (which is probably unlikely)
crontab -e
If you don’t have root access
/root/backup.sh
Rotating 7-day backup
/root/.my.cnf
There are more secure solutions, but if the user has access to your root account and directory, it’s too late anyway