To answer my own question with some help from @ssaltman above, I did it in PHP and used the following code:
<?php
rename(reset(glob("/exist/path/*.tar.gz")), "/new/path/NEWNAME.tar.gz");
?>
I then attached it to a cron job in cpanel.
Вопрос
I have a server backup .tar.gz file that I need to automate it's move to another folder, and rename it to a name I can use to later download it via ftp (I can't use wildcard to download the file so I have to know the name in order to grab it). I have the other pieces straighten out, I just need to know how/what my cron job script should look like. Can I do this via PHP? or do I need something else? Thanks in advance for the help
Решение
To answer my own question with some help from @ssaltman above, I did it in PHP and used the following code:
<?php
rename(reset(glob("/exist/path/*.tar.gz")), "/new/path/NEWNAME.tar.gz");
?>
I then attached it to a cron job in cpanel.