Why the delete must come after the append
The first time I hit this, I called deleteRow before appendRow and spent ten minutes wondering where my data went. When you delete row 5 first, every row below it shifts up by one. If your rowData variable already holds the values, you are safe — but if you were re-reading from the sheet after the delete, you would pull row 6's data thinking it was still row 5. Always append first, delete second. The script above captures rowData into a variable before either operation, so the order technically does not matter for correctness, but keeping append-then-delete is the readable convention and prevents accidents if you ever refactor.
The sheet.getLastColumn() call on line 17 is worth noting: it reads however many columns your source sheet actually uses, so you do not need to hardcode a column count. If you add a column next month, the script still copies it without edits.