Q: Bash file to check changes in a folder and copy in another folder Good morning.
I'm trying to create an Automator app in macOS Mojave. What I want to do is that the app check all changes in a folder when I execute it, and copy the same folder and files estructure in another folder.
I think that all of this can't be done exclusively with a python script, so I'm mixing python and terminal commands. Currently I've a python script in which I create a log file when I execute it. This script is named upload_files.py. The code is below.
import os
import logging
import logging.handlers

name_log = 'flag_MEGA.log'
log_file = os.path.join('./', name_log)

log_formatter = logging.Formatter('%(asctime)s : %(levelname)s : %(message)s')
log_handler   = logging.handlers.RotatingFileHandler(filename    = log_file,
                                                 mode        = 'w', 
                                                 maxBytes    = 3 * 1024 * 1024,
                                                 backupCount = 0)
log_handler.setFormatter(log_formatter)
log_handler.setLevel(logging.DEBUG)
logger = logging.getLogger('error')
logger.setLevel(logging.DEBUG)
logger.addHandler(log_handler)

logger.info('Upload files to MEGA.')

Next step is to check changes in my target folder, named tf_fol, using this line:
find /Users/agarzon/Desktop/tf_fol/ -newermm /Users/agarzon/Desktop/tf_fol/flag_MEGA.log

So, I need to know how to use the output of this last command line as an input of another line the let me copy this files and folders into another folder named backup_folder.
Please, tell me if I don't explain it well and don't understand me.
Thanks you very much in advance.
