Re: Scheduling / automating APIC-EM backups

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2017 06:07 AM - edited 03-01-2019 04:41 AM
I've put together a bash script that creates the backup and then copies it via FTP to a different server. That works properly if it is manually run. But it doesn't work if it is initiated via the crontab.
Here is the script:
$ more ./daily_backup.sh
#!/bin/sh
HOST='10.255.0.100'
USER='anonymous'
PASSWD='network'
FILE='*.backup'
grape backup grow
sleep 10m
cd /srv/grapevine/replicated-storage/backups/*005056b40bcd/
ftp -in $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
bin
cd APIC-EM/Backups/usspvlapic01
mput $FILE
quit
END_SCRIPT
exit 0
I think the problem is with the "grape backup grow" command. This doesn't appear to work from cron.
Am I doing something incorrect? (Please bear in mind that I know enough about Linux to be dangerous to myself and those around me!)
Any insights will be appreciated!
Thanks,
Jason
- Labels:
-
APIC

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2017 07:00 PM
Hi Jason,
this is due to a PATH issue.
You can either update the PATH variable, or just be explicit with the specific with the specification of the "grape" command.
e.g.
/opt/cisco/grapevine/bin/grape
