# systemd unit — one-shot overnight Magento cleanup/publish for connection 4 # # Install (on the PlytixMage app server): # sudo cp scripts/systemd/plytixmage-magento4-overnight.service /etc/systemd/system/ # sudo cp scripts/systemd/plytixmage-magento4-overnight.timer /etc/systemd/system/ # sudo systemctl daemon-reload # sudo systemctl enable --now plytixmage-magento4-overnight.timer # systemctl list-timers | grep plytixmage # journalctl -u plytixmage-magento4-overnight.service -f # # Run once immediately: # sudo systemctl start plytixmage-magento4-overnight.service # # Edit WorkingDirectory / User / Environment to match your server. [Unit] Description=PlytixMage overnight Magento connection 4 cleanup + full publish After=network-online.target Wants=network-online.target [Service] Type=oneshot User=homesurplus Group=homesurplus WorkingDirectory=/home/homesurplus/PlytixMage Environment=MAGENTO_CONNECTION_ID=4 Environment=DRY_RUN=0 Environment=PYTHON=python3 Environment=PYTHONUNBUFFERED=1 Environment=RUN_TAXONOMY_REPAIR=1 Environment=RUN_ATTRIBUTE_REPAIR=1 Environment=ATTRIBUTE_BUNDLES=specs # Optional: append more fields or override the bundle list in the unit # Environment=ATTRIBUTE_FIELDS=manufacturer family collection_style depth soft_close packaged_dimension_height packaged_dimension_width packaged_dimension_depth packaged_gross_weight cabinet_type base_cabinets wall_cabinets panels_and_fillers mouldings angle drawer_box # Optional: point at a venv # Environment=PATH=/home/homesurplus/PlytixMage/.venv/bin:/usr/bin ExecStart=/bin/bash /home/homesurplus/PlytixMage/scripts/overnight_magento_cleanup_publish.sh Nice=10 TimeoutStartSec=16h # Keep a copy in the journal; script also tees to logs/ StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target