A caretaker is a person employed to look after a building.
At Hogwarts, the caretaker has several duties, which are all geared towards keeping the school tidy, quiet and orderly. During Harry's years at Hogwarts, the caretaker was assigned the following tasks:
- Making sure the school remains tidy and clean (CS8).
- Sending students to heads of houses (PS15, HBP15) or the headmistress (OP28) after any rule-breaking, and carrying out the punishment of these students (PS16, CS7).
- Providing lists of forbidden objects and actions for Dumbledore to read during the welcoming feast (PS7, GF12, OP11, HBP8).
- Reminding the students of the school's rules (OP17).
- Cleaning any mess Peeves the poltergeist has caused (pm).
- Checking the list of pupils who are allowed to go to Hogsmeade (PA8, HBP12).
- Keeping records of wrongdoing in a filing cabinet (PA12, HBP24)
Additional tasks for specific purposes
- Adding chairs to the staff table in the Great Hall for visitors and bringing out the Goblet of Fire (GF16).
- Restoring paintings (PA9) and doors (OP30).
- Supporting the staff in standing guard, searching, patrolling or evacuating the castle (CS13, PA9, OP30, DH31).
- Searching students to prevent them from taking in or out any suspected items (OP16, HBP11).
The caretaker stays at Hogwarts during the summer term (SN).
Due to his tasks, the caretaker knows all the shortcuts inside and out of the castle (PS12, PA10, OP28). For example, the current caretaker sometimes found cleaning supplies in the Room of Requirement, according to house-elf Dobby (OP18).
It is not necessary to be a witch or wizard to become a caretaker, as the current caretaker is a squib (CS9).
The current caretaker is Argus Filch. He predecessor was Apollyon Pringle (GF31).
In the films, the role of caretaker is played by David Bradley. In the final film (DH2/f) he is seen cleaning the hall after the battle of Hogwarts. In the books, Filch does clean as well (CS8, CS13), but he could have used house-elves to complete that task.
Also, one does wonder why Filch was allowed to remain at Hogwarts during the year Snape was headmaster, even though he was a squib (DH).