I am trying to copying files from one directory to another directory in Jenkins master machine facing access denied issue while executing in the shell script
cp -a /usr/lib/hook/pm2-logs/. /usr/lib/hook/Hook_Log_Backup/
Issue:
cp: cannot create regular file '/usr/lib/hook/Hook_Log_Backup/./pr_hook_out-0.log': Permission denied cp: cannot create regular file '/usr/lib/hook/Hook_Log_Backup/./pr_hook_err-0.log': Permission denied cp: cannot create regular file '/usr/lib/hook/Hook_Log_Backup/./system_hook_out-1.log': Permission denied cp: cannot create regular file '/usr/lib/hook/Hook_Log_Backup/./system_hook_err-1.log': Permission denied cp: cannot create regular file '/usr/lib/hook/Hook_Log_Backup/./common_hook_out-2.log': Permission denied