Hi Monica and darrigan, thanks for answering me right away.
I use the CaUtils export-data utility to export objects and then I will have to export technical metadata of the media.
I query directly on the database to know the objects to export that have certain characteristics.
In all the objects I have this ca_acl configuration:
ca_acl
group_id, user_id,table_num,row_id,access
(null) (null) 57 289635 0
(null) 1 57 289635 3
2 (null) 57 289635 3
205 (null) 57 289635 3
450 (null) 57 289635 1
with group_id null and user_id null I have no access
this is a part of my code:
mysql -sN -u "$USR" -p"$PASSWD" --host="$HOST" --port=3306 -D "$DB" -e "select distinct object_id from EXPORT_IPAC where data_esito is null;" > $OBJ_FILE
for obj_id in cat $OBJ_FILE
do
echo ---$obj_id---$TIPO_EXPORT---
#--- mi do il permesso sugli oggetti ***** per archivi devo darmi tutta la gerarchia ****
mysql -sN -u "$USR" -p"$PASSWD" --host="$HOST" --port=3306 -D "$DB" -e "update ca_acl set access=3 where table_num=57 and group_id is null and user_id is null and row_id=${obj_id};"
#-- cerco elenco media per object_id
mysql -sN -u "$USR" -p"$PASSWD" --host="$HOST" --port=3306 -D "$DB" -e "select representation_id from EXPORT_IPAC where data_esito is null and representation_id is not null and object_id = ${obj_id};" > $REP_FILE
#-- mi do il permesso sui media
#for rep_id in cat $REP_FILE
#do
#mysql -sN -u "$USR" -p"$PASSWD" --host="$HOST" --port=3306 -D "$DB" -e "update ca_acl set access=3 where table_num=56 and group_id is null and user_id is null and row_id=${rep_id};"
#done
#--- realizzo record passando in input obj_id
NOME_FILE_SCHEDA="$TIPO_EXPORT""$obj_id""$DATA.xml"
NOME_FILE_METS="mets-ecomic""$obj_id""$DATA.xml"
echo $NOME_FILE_SCHEDA
$CA_UTILS export-data -i $obj_id -m $TIPO_EXPORT -f $OUT_DIR/$NOME_FILE_SCHEDA -d DEBUG -l /cabe/export_IPAC/work_dir