I have just set up the .com
of a domain that previous ran on .co.uk
on the same server, I have copied all the files, ran through them using bash to change the domain anywhere it was referenced, same for DB, and all went great, same with the redirect. But now I want to move the cron jobs across using bash.
I was thinking
sudo cat /var/spool/cron/sbadmin | while read -r line; do echo $line;done > /var/spool/cron/sbcomadmin
But permission is denied on the new file. How can permission be denied when I am in sudo mode?
The domain will need changing in the new cron file aswell but I was thinking I could use sed on that, either during the copy or after.