I have a specific case where testing a new version of the software is being done at a specific time of the day so I have cronjob that should:
Software is set in /var/www/html folders V2 and V3 respectively. Therefore I use sed to change the version. a) in the morning change virtual host and restart apache b) in the afternoon change back to an old version and restart apache
Crontab is set like this:
0 9 * * * sed -i 's/V2/V3/g' /etc/apache2/sites-available/software.conf && service apache2 restart
0 14 * * * sed -i 's/V3/V2/g' /etc/apache2/sites-available/software.conf && service apache2 restart
Sed changes the version but apache doesn't restart to apply the changes. Can you please help me fix the issue? Thanks