How archive command works in postgres
from docs:


  The local shell command to execute to archive a completed WAL file
  segment. Any %p in the string is replaced by the path name of the file
  to archive, and any %f is replaced by only the file name. (The path
  name is relative to the working directory of the server, i.e., the
  cluster's data directory.) Use %% to embed an actual % character in
  the command. It is important for the command to return a zero exit
  status only if it succeeds


(emphasis mine) 

Also take a look at setting WAL archiving