Tar backup file 1 day before


/ Published in: Bash
Save to your folder(s)

Script using tar to backup new file created 1 day before


Copy this code and paste it in your HTML
  1. #!/bin/sh
  2.  
  3. YESTERDAY='date +%D -date=-1day'
  4. ( cd /dir/ && tar --create --file=- --newer=$YESTERDAY . ) | ( cd /dest_dir/ && tar xvpf - )

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.