bash - Creating cron entry on server using ssh login within shell script -
i need upload file (bash script) remote sever. use scp command. after file has been copied remote server want create cron entry in crontab file on remote server. however, file upload , writing cron entry need occur within bash shell script need execute script on local machine , script copied remote host , cron entry written crontab.
is there way can use ssh command, within script, logs me remote server, opens crontab file , writes cron entry.
any welcome
i would:
- extract user's crontab
crontab -l > somefile
- modify file desired job
- import new crontab
crontab somefile
Comments
Post a Comment