Skip to content

Instantly share code, notes, and snippets.

@trantrongbinh
Created June 10, 2021 01:39
Show Gist options
  • Save trantrongbinh/88e75f8de5ac3cac28e184c8e5819e23 to your computer and use it in GitHub Desktop.
Save trantrongbinh/88e75f8de5ac3cac28e184c8e5819e23 to your computer and use it in GitHub Desktop.

Revisions

  1. trantrongbinh created this gist Jun 10, 2021.
    15 changes: 15 additions & 0 deletions bash_move_file.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    ```
    #!/bin/bash
    FORDER_M3U8="/data2/upload2/process/video/*"
    FORDER_MP4="/data2/upload2/[email protected]/video"
    FOLDER_MOVE="/backup/backup_m3u8/upload2_data2"
    LOG="/backup/backup_m3u8/logs.txt"
    for f in $FORDER_M3U8; do
    if test -f "$FORDER_MP4/raw-file-$(basename $f).mp4"; then
    mv $f $FOLDER_MOVE;
    echo "$f moved to $FOLDER_MOVE" >> $LOG;
    fi
    done
    ```