Create a macro with this:
/cast Feed Pet
/script PickupContainerItem (0,2);
In your first bag second space, place your food.
Place macro on bar 1 slot 5
Set the macro in general setting / advanced / my macros to kick in every 5-10mins, will keep your pet green and happy unless you go through a continuos death period.