Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 214147

Re: Multiple scheduling in /var/spool/cron/crontab/root

$
0
0

Hello Giuseppe

 

How do you insert multiple jobs via rc.local?

 

Here is an example using /etc/rc.local.d/local.sh

 

#!/bin/sh
# local configuration options

if [ -f /var/spool/cron/crontabs/root ]; then                                                                                          
   /bin/kill $(cat /var/run/crond.pid)                     

                                                                                                                                                                               
   /bin/echo "# Insert by /etc/rc.local.d/local.sh" >> /var/spool/cron/crontabs/root                                 
   /bin/echo "0 0 * * 1-4 /vmfs/volumes/datastore/ghetto/ghettoVCB.sh -f /vmfs/volumes/datastore/ghetto/vms_to_backup1  >  /vmfs/volumes/datastore/ghetto/ghettoVCB-backup-$(date +\%s).log" >> /var/spool/cron/crontabs/root
   /bin/echo "# Insert by /etc/rc.local.d/local.sh" >> /var/spool/cron/crontabs/root                                 
   /bin/echo "0 0 * * 2-5 /vmfs/volumes/datastore/ghetto/ghettoVCB.sh -f /vmfs/volumes/datastore/ghetto/vms_to_backup2  >  /vmfs/volumes/datastore/ghetto/ghettoVCB-backup-$(date +\%s).log" >> /var/spool/cron/crontabs/root                                                        
   /bin/echo "# Insert by /etc/rc.local.d/local.sh" >> /var/spool/cron/crontabs/root                                                                                                                                                           
   /bin/echo "0 0 * * 3-6 /vmfs/volumes/datastore/ghetto/ghettoVCB.sh -f /vmfs/volumes/datastore/ghetto/vms_to_backup3  >  /vmfs/volumes/datastore/ghetto/ghettoVCB-backup-$(date +\%s).log" >> /var/spool/cron/crontabs/root

                    
   /usr/lib/vmware/busybox/bin/busybox crond                                                                                           
fi

#

 

It should work.

 

Best regards

Jörg


Viewing all articles
Browse latest Browse all 214147

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>