Currently I create a copy of my log files like this:
# tar -cvzf /var/www/vhosts/example.com/httpdocs/myfiles.tar.gz /var/www/vhosts/example.com/logs/access_log /var/www/vhosts/example.com/httpdocs/app/tmp/logs/error.log /var/log/mysqld.log /var/log/messages /var/log/httpd/access_log /var/log/httpd/suexec_log /var/log/httpd/error_log /var/log/sw-cp-server/error_log /usr/local/psa/var/log/xferlog /etc/php.ini
But this creates a tar files with the directory structure. To avoid folder structure it seems like I should make
cd for each file, so all files will be saved to tar file without subfolders. (Also there is a problem with tar.gz files, tar command doesn't permit to update archieve file, if file is compressed)
But in this case there will be multiple files with same name, for example 2 file with name access_log.
So I need to change destination log file name.
/var/www/vhosts/example.com/logs/access_log to -var-www-vhosts-example.com-logs-access_log /var/log/httpd/access_log to -var-log-httpd-access_log
Is this possible to archieve these files without the directory structure and with the file name changes ? Note that files exists in different folders.