Backup path for cron problem

does anyone see anything wrong with this path for my cron job to do backup, I cant get it to work, though had it working before. Host admin says it fires ok?? but no backups appear in admin or backup directory

/opt/cpanel/ea-php74/root/usr/bin/php /home2/hiviscou/public_html/myadminhere.php -p --dispatch=datakeeper.backup --backup_database=Y --backup_files=Y --dbdump_schema=Y --dbdump_data=Y --dbdump_tables=all --extra_folders[0]=var/files --extra_folders[1]=var/attachments --extra_folders[2]=var/langs --extra_folders[3]=images

reply from host if anyone can help

dear John
I’ve attached logs from the server showing the cron is getting executed correctly to run every hour at the 2nd minute. However, it seems it’s not creating the backup files under /home2/hiviscou/public_html/var/backups as it should.

Therefore, I manually ran the cron and it has generated the following output showing the backup completed successfully.


Backup filesCopy files: appCopy files: designCopy files: jsCopy files: .htaccessCopy files: api.phpCopy files: config.local.phpCopy files: config.phpCopy files: index.phpCopy files: init.phpCopy files: robots.txtCopy files: var/themes_repositoryCopy files: var/snapshotsCopy files: upgrades/source_restore.phpCopy files: youradmin.php Copy files: var/filesCopy files: var/attachmentsCopy files: var/langsCopy files: imagesCompressing backup file[Notice] Done

Can you please review the cron again for its integrity and the file youradmim.php itself? I think the errors logged by the webserver has got something to do with the backup file creation failure by the cron.


[Fri Nov 01 23:20:25.682509 2024] [:error] [pid 27438:tid 27440] [client 82.33.39.226:41700] PHP: syntax error, unexpected ’ (’ in ./httpd.ini on line 13, referer: https://www.hivis.co.uk/youradmin.php?dispatch=orders.details&order_id=232569
[Fri Nov 01 23:20:25.713362 2024] [:error] [pid 2079:tid 2081] [client 82.33.39.226:41690] PHP: syntax error, unexpected ‘(’ in ./httpd.ini on line 13, referer: https://www.hivis.co.uk/youradmin.php?dispatch=orders.details&order_id=232569

Hi!

There is no need to pass numbers in --extra_folders[] parameter, it will enumerate them automatically.

As for the missing backups, could you please check the /var/backups/ folder inside your installation? Also the provided entries from the error_log are irrelevant.

Thanks for the reply
The cron requested backups dont exisit in /var/backups only the ones I do manually exsist.
I used the numbers in the --extra_folders[] parameter, from the data in admin link, but have removed them now to test.

I will let you know how it goes

no, still doesnt seem to create backups in var/backups, host support responded this, but -q doesnt seem to help either, I still get error emailed from server, permissions on my admin.php are 0644

Could not open input file: /home/hiviscou/public_html/myadmin.php

Hello John,

Thank you for contacting us,

do you think /home2/ should be replaced as /home/ in the hiviscou cron?

As I understand, there should be no difference when using /home instead of /home2 as the symlink is set for this user. However, you can try below command in cron and see if it works:

/opt/cpanel/ea-php74/root/usr/bin/php /home/hiviscou/public_html/myadmin.php -q

instead of

/opt/cpanel/ea-php74/root/usr/bin/php /home/hiviscou/public_html/myadmin.php -p

Use -q when you want to execute a script without any HTTP headers in the output.
Use -p when you want to check for syntax errors in a PHP script without executing it.
It still an issue, please review the cron again for its integrity and the file poloshirt.php itself as suggested previously.

I hope this helps.

Feel free to contact us if there is anything else we can assist you with.

Kind Regards,
Peter G.

2nd Line Support Engineer [Linux]

Since this error has appeared, I would like to ask if you are sure that the path to the admin panel script is correct?

but yet this backup below on the same server works,

/opt/cpanel/ea-php74/root/usr/bin/php /home/machworkwearco/public_html/myadmin.php -p --dispatch=datakeeper.backup --backup_database=Y --backup_files=N --dbdump_schema=Y --dbdump_data=Y --dbdump_tables=all --extra_folders[0]=var/files --extra_folders[1]=var/attachments --extra_folders[2]=var/langs --extra_folders[3]=images

could it be the database size, the one that is not working is 3,797,560,257 bytes
the one that does work is only 2,342,144 bytes

so tried again and the only difference in the one in the previous post that works and the one that has trouble (below) is the admin name and the cpanel username
sorry cant change the bold text above

/opt/cpanel/ea-php74/root/usr/bin/php /home/hiviscou/public_html/myadmin.php -p --dispatch=datakeeper.backup --backup_database=Y --backup_files=N --dbdump_schema=Y --dbdump_data=Y --dbdump_tables=all --extra_folders[0]=var/files --extra_folders[1]=var/attachments --extra_folders[2]=var/langs --extra_folders[3]=images

So there’s definitely something wrong with the server settings, as the same command works in one environment and doesn’t in the other.

Please ask your hosting support to check the error logs and cron command results.