Hello lamw,
i have some news for you
thank you for helping me so intensive. I made a advance in backing up vm´s on an esxi host
But, i have another question.
I create my cronjob in the following file: /var/spool/cron/crontabs/root
*/5 * * * * /vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -a -g ghettoVCB.conf > /vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB-backup-$(date +\%s).log
after that, i saved the file and kill the running daemon and restarted him. All is wokring fine until here! The crond is running!
I have set, only for testing, that is should backup all vm´s every 5min! only testing!!
After every 5min, the cronjob is running, but he dont backup my vm´s.The daemon is creating the logfile and there is an error listet.
Logging output to "/tmp/ghettoVCB-2013-01-13_12-25-01-5280.log" ...
2013-01-13 12:25:01 -- info: ERROR: "ghettoVCB.conf" is not valid global configuration file!
###############################################################################
#
# ghettoVCB for ESX/ESXi 3.5, 4.x+ and 5.x
# Author: William Lam
# http://www.virtuallyghetto.com/
# Documentation: http://communities.vmware.com/docs/DOC-8760
# Created: 11/17/2008
# Last modified: 2013_01_11 Version 0
#
###############################################################################
Usage: ghettoVCB.sh [options]
OPTIONS:
-a Backup all VMs on host
-f List of VMs to backup
-m Name of VM to backup (overrides -f)
-c VM configuration directory for VM backups
-g Path to global ghettoVCB configuration file
-l File to output logging
-w ghettoVCB work directory (default: /tmp/ghettoVCB.work)
-d Debug level [info|debug|dryrun] (default: info)
(e.g.)
Backup VMs stored in a list
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -f vms_to_backup
Backup a single VM
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -m vm_to_backup
Backup all VMs residing on this host
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -a
Backup all VMs residing on this host except for the VMs in the exclusion list
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -a -e vm_exclusion_list
Backup VMs based on specific configuration located in directory
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -f vms_to_backup -c vm_backup_configs
Backup VMs using global ghettoVCB configuration file
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -f vms_to_backup -g /global/ghettoVCB.conf
Output will log to /tmp/ghettoVCB.log (consider logging to local or remote datastore to persist logs)
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -f vms_to_backup -l /vmfs/volume/local-storage/ghettoVCB.log
Dry run (no backup will take place)
/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -f vms_to_backup -d dryrun
2013-01-13 12:25:01 -- info: ============================== ghettoVCB LOG START ==============================
2013-01-13 12:25:01 -- info: CONFIG - USING GLOBAL GHETTOVCB CONFIGURATION FILE = ghettoVCB.conf
2013-01-13 12:25:01 -- info: CONFIG - VERSION = 2013_01_11_0
2013-01-13 12:25:01 -- info: CONFIG - GHETTOVCB_PID = 5280
2013-01-13 12:25:01 -- info: CONFIG - VM_BACKUP_VOLUME =
2013-01-13 12:25:01 -- info: CONFIG - VM_BACKUP_ROTATION_COUNT =
2013-01-13 12:25:01 -- info: CONFIG - VM_BACKUP_DIR_NAMING_CONVENTION = 2013-01-13_12-25-01
2013-01-13 12:25:02 -- info: CONFIG - DISK_BACKUP_FORMAT =
2013-01-13 12:25:02 -- info: CONFIG - POWER_VM_DOWN_BEFORE_BACKUP =
2013-01-13 12:25:02 -- info: CONFIG - ENABLE_HARD_POWER_OFF =
2013-01-13 12:25:02 -- info: CONFIG - ITER_TO_WAIT_SHUTDOWN =
2013-01-13 12:25:02 -- info: CONFIG - POWER_DOWN_TIMEOUT =
2013-01-13 12:25:02 -- info: CONFIG - SNAPSHOT_TIMEOUT =
2013-01-13 12:25:02 -- info: CONFIG - LOG_LEVEL = info
2013-01-13 12:25:02 -- info: CONFIG - BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2013-01-13_12-25-01-5280.log
2013-01-13 12:25:02 -- info: CONFIG - VM_SNAPSHOT_MEMORY =
2013-01-13 12:25:02 -- info: CONFIG - VM_SNAPSHOT_QUIESCE =
2013-01-13 12:25:02 -- info: CONFIG - ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP =
2013-01-13 12:25:02 -- info: CONFIG - VMDK_FILES_TO_BACKUP =
2013-01-13 12:25:02 -- info: CONFIG - VM_SHUTDOWN_ORDER =
2013-01-13 12:25:02 -- info: CONFIG - VM_STARTUP_ORDER =
2013-01-13 12:25:02 -- info: CONFIG - EMAIL_LOG =
2013-01-13 12:25:02 -- info:
2013-01-13 12:25:07 -- info: ERROR: Variable VM_BACKUP_VOLUME was not defined
Waht i do wrong?!
independent to this error, the command "ghettoVCB.sh -a -g ghettoVCB.conf" is wokring fine without be in an cronjob!