Backup all namespaces

i’ve a bit troubled with backup aerospike namespaces, sure i know how to do it, but i want to do backup use 1 command Documentation says that Backup performs using this command asbackup --host localhost --namespace test --directory backup.2018 but in this command only 1 namespace name is allow, i’ve try to use globbin * or -all but this stuff isn’t working. Any help will be appreciated

You can’t have asbackup backup multiple namespaces. You’ll have to write a for loop or something… like this

for namespace in `asinfo -lv 'namespaces'`;do asbackup -h hostname -n ${namespace} --directory ${namespace}.${date +%m.%d.%Y};done

Or use & done to back them up at the same time… (background jobs)

for namespace in `asinfo -lv 'namespaces'`;do asbackup -h hostname -n ${namespace} --directory ${namespace}.${date +%m.%d.%Y} & done

Note: extra ticks “`” included because of forum limitations :expressionless:

Lgtm if I use code blocks instead of quote blocks.

1 Like