Green’s Dictionary of Slang

for crap’s sake! excl.

also crapsake! for crapsake!
[euph. for for Christ’s sake! excl.]

[1930s+] (orig. US) a general excl. of annoyance, surprise etc.