But it also a military tradition dating back to the 17th century of calling soldiers or sailors back to their quarters at night with a drum or bugle .