-2

I'm currently working on a script where I have to send an email with this information:

  • List of files backed up.

  • What files were recently modified? Say 1 or 2 hours.

  • Size and location of the backup in the host.

This is what I have done so far:

echo "Message" | mailx -s "Subject" -a path/ofthe/file.tar aaa@mail.com

This sends a mail with attaching the .tar file but I need to know what files where changed, if there were any.

Rishabh Agarwal
  • 1,988
  • 1
  • 16
  • 33
  • For files modified look here - https://stackoverflow.com/questions/33407344/how-to-find-files-modified-in-last-x-minutes-find-mmin-does-not-work-as-expect – naman Dec 10 '18 at 18:50
  • This is much too broad. Google the individual questions, then tell us where exactly you get stuck gluing the pieces together. – tripleee Dec 10 '18 at 18:55
  • For other info. check this - https://stackoverflow.com/a/4887607/5265615 – naman Dec 10 '18 at 18:57

2 Answers2

0

Try this:

tar -tvf path/ofthe/file.tar > /tmp/files.txt
cat /tmp/files.txt | mailx -s "Subject" -a path/ofthe/file.tar aaa@mail.com; rm /tmp/files.txt
wuseman
  • 1,259
  • 12
  • 20
0
find . -name "*" -mmin -60|grep -v "^.$"

Find the current folder and change the file within 60 minutes

bbotte
  • 168
  • 5