[RDD] Automatically deleting carts

Alessio Elmi alessio_elmi at hotmail.com
Mon Jun 6 10:14:40 EDT 2016


Hi,
we do it in a "safer" way rather than acting on the database directly. We
demand the task to the web service. Here some excerpt of the bash script
that takes care of it.

list="$($mysql -u$user -p$password -h$host $database -Bse "SELECT NUMBER
FROM CART WHERE GROUP_NAME='$GROUP1';")"
for i in ${list[@]}; do
curl -d
COMMAND=13\&LOGIN_NAME=$rivuser\&PASSWORD=$rivpassword\&CART_NUMBER=$i
$rdxport
done

...where $rdxport iin our case is equal to "
http://localhost/rd-bin/rdxport.cgi". The other variable are self
explicative. Anyway just as if in doubt.

I think this is safer in a way that the SQL user only needs SELECT
permission, and it doesn't need to know the actual table design. Acting
directly on CART and CUT table may become dangerous if some SQL changes
will be in the future. On the contrary, rdxport service is supposed to be
updated accordingly.

Hope it helps

Alessio

Il giorno lun 6 giu 2016 alle ore 03:10 Nick Andre <nick at wmfo.org> ha
scritto:

> You can delete the CUT and CART entries from the respective tables. Just
> make sure to regenerate logs that might contain them. Not sure what other
> db references you have to clean up though.
> On Sun, Jun 5, 2016 at 20:48 Dan Gruner <dan at loudaudio.co.uk> wrote:
>
>> I need a way to automatically purge carts in a specific group (for
>> example 'TEMP') that can be setup as an action in RdCatch say every
>> week.  Is there an easy way to do this?
>>
>> Thanks,
>>
>> Dan
>>
>> _______________________________________________
>> Rivendell-dev mailing list
>> Rivendell-dev at lists.rivendellaudio.org
>> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>>
> _______________________________________________
> Rivendell-dev mailing list
> Rivendell-dev at lists.rivendellaudio.org
> http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://caspian.paravelsystems.com/pipermail/rivendell-dev/attachments/20160606/ab7879e9/attachment.html>


More information about the Rivendell-dev mailing list