def _to_qstat_command(output_file, user=None):
    """Generate a qstat command to supplied output_file"""
    u = "*" if user is None else user
    cmd = 'qstat -u "{u}" -xml > {o}'.format(u=u, o=output_file)
    return cmd